From 0ab56321be7a65e2894f29aea685aa5a81afae9b Mon Sep 17 00:00:00 2001 From: lacatoire Date: Fri, 6 Feb 2026 14:49:43 +0100 Subject: [PATCH 1/2] Add documentation for 6 new pcntl functions Add documentation pages for pcntl functions available since PHP 8.4: - pcntl_wifcontinued: Check if child continued from job control stop - pcntl_getcpu: Get current CPU number (Linux) - pcntl_forkx: Create child process using forkx(2) (illumos/Solaris) - pcntl_setns: Reassociate process with namespace (Linux) - pcntl_getqos_class: Get process QoS class (macOS) - pcntl_setqos_class: Set process QoS class (macOS) --- reference/pcntl/functions/pcntl-forkx.xml | 83 ++++++++++++++++++ reference/pcntl/functions/pcntl-getcpu.xml | 63 ++++++++++++++ .../pcntl/functions/pcntl-getqos-class.xml | 63 ++++++++++++++ reference/pcntl/functions/pcntl-setns.xml | 87 +++++++++++++++++++ .../pcntl/functions/pcntl-setqos-class.xml | 81 +++++++++++++++++ .../pcntl/functions/pcntl-wifcontinued.xml | 78 +++++++++++++++++ 6 files changed, 455 insertions(+) create mode 100644 reference/pcntl/functions/pcntl-forkx.xml create mode 100644 reference/pcntl/functions/pcntl-getcpu.xml create mode 100644 reference/pcntl/functions/pcntl-getqos-class.xml create mode 100644 reference/pcntl/functions/pcntl-setns.xml create mode 100644 reference/pcntl/functions/pcntl-setqos-class.xml create mode 100644 reference/pcntl/functions/pcntl-wifcontinued.xml diff --git a/reference/pcntl/functions/pcntl-forkx.xml b/reference/pcntl/functions/pcntl-forkx.xml new file mode 100644 index 000000000000..a802544424b8 --- /dev/null +++ b/reference/pcntl/functions/pcntl-forkx.xml @@ -0,0 +1,83 @@ + + + + pcntl_forkx + Create a child process using forkx(2) + + + + &reftitle.description; + + intpcntl_forkx + intflags + + + The pcntl_forkx function creates a child process + using the forkx(2) system call, which is available + on illumos and Solaris systems. + + + + + &reftitle.parameters; + + + + flags + + + The flags parameter controls the behavior + of the fork. Pass 0 for default behavior or + FORK_NOSIGCHLD to prevent the + SIGCHLD signal from being sent to the parent + when the child terminates. + + + + + + + + + &reftitle.returnvalues; + + On success, the PID of the child process is returned in the + parent's thread of execution, and a 0 is returned + in the child's thread of execution. On failure, a -1 + will be returned in the parent's context, no child process will be + created, and a PHP error is raised. + + + + + &reftitle.seealso; + + + pcntl_fork + pcntl_rfork + pcntl_waitpid + + + + + + diff --git a/reference/pcntl/functions/pcntl-getcpu.xml b/reference/pcntl/functions/pcntl-getcpu.xml new file mode 100644 index 000000000000..7d37a495ba64 --- /dev/null +++ b/reference/pcntl/functions/pcntl-getcpu.xml @@ -0,0 +1,63 @@ + + + + pcntl_getcpu + Get the CPU number on which the calling process last executed + + + + &reftitle.description; + + intpcntl_getcpu + + + + pcntl_getcpu returns the number of the CPU on which + the calling process was last executed. This function uses the + sched_getcpu(3) system call available on Linux. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns the CPU number as an &integer;. + + + + + &reftitle.seealso; + + + pcntl_getcpuaffinity + pcntl_setcpuaffinity + + + + + + diff --git a/reference/pcntl/functions/pcntl-getqos-class.xml b/reference/pcntl/functions/pcntl-getqos-class.xml new file mode 100644 index 000000000000..0900d1dfba65 --- /dev/null +++ b/reference/pcntl/functions/pcntl-getqos-class.xml @@ -0,0 +1,63 @@ + + + + pcntl_getqos_class + Get the current Quality of Service class of the process + + + + &reftitle.description; + + Pcntl\QosClasspcntl_getqos_class + + + + 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. + + + + + &reftitle.parameters; + &no.function.parameters; + + + + &reftitle.returnvalues; + + Returns a Pcntl\QosClass enum value representing + the current QoS class. + + + + + &reftitle.seealso; + + + pcntl_setqos_class + + + + + + diff --git a/reference/pcntl/functions/pcntl-setns.xml b/reference/pcntl/functions/pcntl-setns.xml new file mode 100644 index 000000000000..798ad7c6ad0f --- /dev/null +++ b/reference/pcntl/functions/pcntl-setns.xml @@ -0,0 +1,87 @@ + + + + pcntl_setns + Reassociate the calling process with a namespace of another process + + + + &reftitle.description; + + boolpcntl_setns + intnullprocess_id&null; + intnstypeCLONE_NEWNET + + + Reassociates the calling process with a Linux namespace of the process + specified by process_id, using a pidfd obtained + via pidfd_open(2) and setns(2). + + + + + &reftitle.parameters; + + + + process_id + + + The process ID of the target process whose namespace to join. + If &null;, the calling process's own PID is used. + + + + + nstype + + + The namespace type to reassociate with. Defaults to + CLONE_NEWNET (network namespace). + Possible values include CLONE_NEWNET, + CLONE_NEWIPC, + CLONE_NEWUTS, and others. + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.seealso; + + + pcntl_unshare + + + + + + diff --git a/reference/pcntl/functions/pcntl-setqos-class.xml b/reference/pcntl/functions/pcntl-setqos-class.xml new file mode 100644 index 000000000000..8eaca258fed5 --- /dev/null +++ b/reference/pcntl/functions/pcntl-setqos-class.xml @@ -0,0 +1,81 @@ + + + + pcntl_setqos_class + Set the Quality of Service class of the process + + + + &reftitle.description; + + voidpcntl_setqos_class + Pcntl\QosClassqos_classPcntl\QosClass::Default + + + 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. + + + + + &reftitle.parameters; + + + + qos_class + + + The QoS class to set. Must be one of the + Pcntl\QosClass enum values: + + Pcntl\QosClass::UserInteractive + Pcntl\QosClass::UserInitiated + Pcntl\QosClass::Default + Pcntl\QosClass::Utility + Pcntl\QosClass::Background + + + + + + + + + + &reftitle.returnvalues; + + &return.void; + + + + + &reftitle.seealso; + + + pcntl_getqos_class + + + + + + diff --git a/reference/pcntl/functions/pcntl-wifcontinued.xml b/reference/pcntl/functions/pcntl-wifcontinued.xml new file mode 100644 index 000000000000..47a992ee4345 --- /dev/null +++ b/reference/pcntl/functions/pcntl-wifcontinued.xml @@ -0,0 +1,78 @@ + + + + pcntl_wifcontinued + Checks whether the child process has continued from a job control stop + + + + &reftitle.description; + + boolpcntl_wifcontinued + intstatus + + + Checks whether the child process which caused the return of + pcntl_waitpid has continued from a job control stop. + This function is only useful if the call to + pcntl_waitpid was done using the + WCONTINUED option. + + + + + &reftitle.parameters; + + + + status + + &pcntl.parameter.status; + + + + + + + + &reftitle.returnvalues; + + Returns &true; if the child process which caused the return of + pcntl_waitpid has continued from a job control stop, + &false; otherwise. + + + + + &reftitle.seealso; + + + pcntl_waitpid + pcntl_wifstopped + pcntl_wifexited + pcntl_wifsignaled + + + + + + From 0fe1234ccf6f86fc8456aa7e8005d4bfd6047fba Mon Sep 17 00:00:00 2001 From: lacatoire Date: Mon, 25 May 2026 10:15:00 +0200 Subject: [PATCH 2/2] pcntl: use simpara for inline paragraphs --- reference/pcntl/functions/pcntl-forkx.xml | 12 ++++++------ reference/pcntl/functions/pcntl-getcpu.xml | 8 ++++---- reference/pcntl/functions/pcntl-getqos-class.xml | 8 ++++---- reference/pcntl/functions/pcntl-setns.xml | 16 ++++++++-------- reference/pcntl/functions/pcntl-setqos-class.xml | 8 ++++---- reference/pcntl/functions/pcntl-wifcontinued.xml | 8 ++++---- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/reference/pcntl/functions/pcntl-forkx.xml b/reference/pcntl/functions/pcntl-forkx.xml index a802544424b8..e867f3dec45b 100644 --- a/reference/pcntl/functions/pcntl-forkx.xml +++ b/reference/pcntl/functions/pcntl-forkx.xml @@ -11,11 +11,11 @@ intpcntl_forkx intflags - + The pcntl_forkx function creates a child process using the forkx(2) system call, which is available on illumos and Solaris systems. - + @@ -25,13 +25,13 @@ flags - + The flags parameter controls the behavior of the fork. Pass 0 for default behavior or FORK_NOSIGCHLD to prevent the SIGCHLD signal from being sent to the parent when the child terminates. - + @@ -40,13 +40,13 @@ &reftitle.returnvalues; - + On success, the PID of the child process is returned in the parent's thread of execution, and a 0 is returned in the child's thread of execution. On failure, a -1 will be returned in the parent's context, no child process will be created, and a PHP error is raised. - + diff --git a/reference/pcntl/functions/pcntl-getcpu.xml b/reference/pcntl/functions/pcntl-getcpu.xml index 7d37a495ba64..5516b7b5b4af 100644 --- a/reference/pcntl/functions/pcntl-getcpu.xml +++ b/reference/pcntl/functions/pcntl-getcpu.xml @@ -11,11 +11,11 @@ intpcntl_getcpu - + pcntl_getcpu returns the number of the CPU on which the calling process was last executed. This function uses the sched_getcpu(3) system call available on Linux. - + @@ -25,9 +25,9 @@ &reftitle.returnvalues; - + Returns the CPU number as an &integer;. - + diff --git a/reference/pcntl/functions/pcntl-getqos-class.xml b/reference/pcntl/functions/pcntl-getqos-class.xml index 0900d1dfba65..afaeb8945292 100644 --- a/reference/pcntl/functions/pcntl-getqos-class.xml +++ b/reference/pcntl/functions/pcntl-getqos-class.xml @@ -11,11 +11,11 @@ Pcntl\QosClasspcntl_getqos_class - + 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. - + @@ -25,10 +25,10 @@ &reftitle.returnvalues; - + Returns a Pcntl\QosClass enum value representing the current QoS class. - + diff --git a/reference/pcntl/functions/pcntl-setns.xml b/reference/pcntl/functions/pcntl-setns.xml index 798ad7c6ad0f..702a5426c978 100644 --- a/reference/pcntl/functions/pcntl-setns.xml +++ b/reference/pcntl/functions/pcntl-setns.xml @@ -12,11 +12,11 @@ intnullprocess_id&null; intnstypeCLONE_NEWNET - + Reassociates the calling process with a Linux namespace of the process specified by process_id, using a pidfd obtained via pidfd_open(2) and setns(2). - + @@ -26,22 +26,22 @@ process_id - + The process ID of the target process whose namespace to join. If &null;, the calling process's own PID is used. - + nstype - + The namespace type to reassociate with. Defaults to CLONE_NEWNET (network namespace). Possible values include CLONE_NEWNET, CLONE_NEWIPC, CLONE_NEWUTS, and others. - + @@ -50,9 +50,9 @@ &reftitle.returnvalues; - + &return.success; - + diff --git a/reference/pcntl/functions/pcntl-setqos-class.xml b/reference/pcntl/functions/pcntl-setqos-class.xml index 8eaca258fed5..5a0b660da32e 100644 --- a/reference/pcntl/functions/pcntl-setqos-class.xml +++ b/reference/pcntl/functions/pcntl-setqos-class.xml @@ -11,11 +11,11 @@ voidpcntl_setqos_class Pcntl\QosClassqos_classPcntl\QosClass::Default - + 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. - + @@ -44,9 +44,9 @@ &reftitle.returnvalues; - + &return.void; - + diff --git a/reference/pcntl/functions/pcntl-wifcontinued.xml b/reference/pcntl/functions/pcntl-wifcontinued.xml index 47a992ee4345..08b0246b7bfe 100644 --- a/reference/pcntl/functions/pcntl-wifcontinued.xml +++ b/reference/pcntl/functions/pcntl-wifcontinued.xml @@ -11,13 +11,13 @@ boolpcntl_wifcontinued intstatus - + Checks whether the child process which caused the return of pcntl_waitpid has continued from a job control stop. This function is only useful if the call to pcntl_waitpid was done using the WCONTINUED option. - + @@ -36,11 +36,11 @@ &reftitle.returnvalues; - + Returns &true; if the child process which caused the return of pcntl_waitpid has continued from a job control stop, &false; otherwise. - +