Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions reference/pcntl/functions/pcntl-forkx.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.pcntl-forkx" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_forkx</refname>
<refpurpose>Create a child process using forkx(2)</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>pcntl_forkx</methodname>
<methodparam><type>int</type><parameter>flags</parameter></methodparam>
</methodsynopsis>
<para>
The <function>pcntl_forkx</function> function creates a child process
using the <literal>forkx(2)</literal> system call, which is available
on illumos and Solaris systems.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>
The <parameter>flags</parameter> parameter controls the behavior
of the fork. Pass <literal>0</literal> for default behavior or
<constant>FORK_NOSIGCHLD</constant> to prevent the
<constant>SIGCHLD</constant> signal from being sent to the parent
when the child terminates.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
On success, the PID of the child process is returned in the
parent's thread of execution, and a <literal>0</literal> is returned
in the child's thread of execution. On failure, a <literal>-1</literal>
will be returned in the parent's context, no child process will be
created, and a PHP error is raised.
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pcntl_fork</function></member>
<member><function>pcntl_rfork</function></member>
<member><function>pcntl_waitpid</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
63 changes: 63 additions & 0 deletions reference/pcntl/functions/pcntl-getcpu.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.pcntl-getcpu" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_getcpu</refname>
<refpurpose>Get the CPU number on which the calling process last executed</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>pcntl_getcpu</methodname>
<void/>
</methodsynopsis>
<para>
<function>pcntl_getcpu</function> returns the number of the CPU on which
the calling process was last executed. This function uses the
<literal>sched_getcpu(3)</literal> system call available on Linux.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the CPU number as an &integer;.
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pcntl_getcpuaffinity</function></member>
<member><function>pcntl_setcpuaffinity</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
63 changes: 63 additions & 0 deletions reference/pcntl/functions/pcntl-getqos-class.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.pcntl-getqos-class" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_getqos_class</refname>
<refpurpose>Get the current Quality of Service class of the process</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>Pcntl\QosClass</type><methodname>pcntl_getqos_class</methodname>
<void/>
</methodsynopsis>
<para>
Returns the current Quality of Service (QoS) class of the calling process.
This function is only available on macOS, which uses QoS classes to
manage energy efficiency and performance.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a <classname>Pcntl\QosClass</classname> enum value representing
the current QoS class.
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pcntl_setqos_class</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
87 changes: 87 additions & 0 deletions reference/pcntl/functions/pcntl-setns.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.pcntl-setns" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_setns</refname>
<refpurpose>Reassociate the calling process with a namespace of another process</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>pcntl_setns</methodname>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>process_id</parameter><initializer>&null;</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>nstype</parameter><initializer><constant>CLONE_NEWNET</constant></initializer></methodparam>
</methodsynopsis>
<para>
Reassociates the calling process with a Linux namespace of the process
specified by <parameter>process_id</parameter>, using a pidfd obtained
via <literal>pidfd_open(2)</literal> and <literal>setns(2)</literal>.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>process_id</parameter></term>
<listitem>
<para>
The process ID of the target process whose namespace to join.
If &null;, the calling process's own PID is used.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>nstype</parameter></term>
<listitem>
<para>
The namespace type to reassociate with. Defaults to
<constant>CLONE_NEWNET</constant> (network namespace).
Possible values include <constant>CLONE_NEWNET</constant>,
<constant>CLONE_NEWIPC</constant>,
<constant>CLONE_NEWUTS</constant>, and others.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pcntl_unshare</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
81 changes: 81 additions & 0 deletions reference/pcntl/functions/pcntl-setqos-class.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<?xml version="1.0" encoding="utf-8"?>
<refentry xml:id="function.pcntl-setqos-class" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>pcntl_setqos_class</refname>
<refpurpose>Set the Quality of Service class of the process</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>pcntl_setqos_class</methodname>
<methodparam choice="opt"><type>Pcntl\QosClass</type><parameter>qos_class</parameter><initializer>Pcntl\QosClass::Default</initializer></methodparam>
</methodsynopsis>
<para>
Sets the Quality of Service (QoS) class of the calling process.
This function is only available on macOS, which uses QoS classes to
manage energy efficiency and performance.
</para>
</refsect1>

<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>qos_class</parameter></term>
<listitem>
<para>
The QoS class to set. Must be one of the
<classname>Pcntl\QosClass</classname> enum values:
<simplelist>
<member><literal>Pcntl\QosClass::UserInteractive</literal></member>
<member><literal>Pcntl\QosClass::UserInitiated</literal></member>
<member><literal>Pcntl\QosClass::Default</literal></member>
<member><literal>Pcntl\QosClass::Utility</literal></member>
<member><literal>Pcntl\QosClass::Background</literal></member>
</simplelist>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>

<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>pcntl_getqos_class</function></member>
</simplelist>
</para>
</refsect1>

</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
Loading