-
Notifications
You must be signed in to change notification settings - Fork 764
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHP 8.4] pcntl add cpu affinity calls. (#4346)
Co-authored-by: Gina Peter Banyard <girgias@php.net>
- Loading branch information
Showing
3 changed files
with
175 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.pcntl-getcpuaffinity" xmlns="http://docbook.org/ns/docbook"> | ||
<refnamediv> | ||
<refname>pcntl_getcpuaffinity</refname> | ||
<refpurpose>Get the cpu affinity of a process</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type class="union"><type>bool</type><type>array</type></type><methodname>pcntl_getcpuaffinity</methodname> | ||
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>pid</parameter><initializer>&null;</initializer></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Retrieve the cpu affinity of the <parameter>pid</parameter>. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>pid</parameter></term> | ||
<listitem> | ||
<simpara> | ||
If &null;, the current process ID is used. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
Returns the cpu affinity mask of the process, &return.falseforfailure;. | ||
</simpara> | ||
&return.falseproblem; | ||
</refsect1> | ||
|
||
<refsect1 role="errors"> | ||
&reftitle.errors; | ||
<simpara> | ||
A <classname>ValueError</classname> is thrown when | ||
<parameter>pid</parameter> is an invalid process id | ||
or the cpu mask had failed to be created.. | ||
</simpara> | ||
<simpara> | ||
If <parameter>pid</parameter> is a process for which the current | ||
user has no allowed permission, a <constant>E_WARNING</constant> | ||
is emitted. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>pcntl_setcpuaffinity</function></member> | ||
</simplelist> | ||
</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 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<!-- $Revision$ --> | ||
<refentry xml:id="function.pcntl-setcpuaffinity" xmlns="http://docbook.org/ns/docbook"> | ||
<refnamediv> | ||
<refname>pcntl_setcpuaffinity</refname> | ||
<refpurpose>Set the cpu affinity of a process</refpurpose> | ||
</refnamediv> | ||
|
||
<refsect1 role="description"> | ||
&reftitle.description; | ||
<methodsynopsis> | ||
<type>bool</type><methodname>pcntl_setcpuaffinity</methodname> | ||
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>pid</parameter><initializer>&null;</initializer></methodparam> | ||
<methodparam choice="opt"><type>array</type><parameter>hmask</parameter></methodparam> | ||
</methodsynopsis> | ||
<simpara> | ||
Sets the cpu affinity for the <parameter>pid</parameter> with the cpu affinity mask given by | ||
<parameter>hmask</parameter>. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="parameters"> | ||
&reftitle.parameters; | ||
<variablelist> | ||
<varlistentry> | ||
<term><parameter>pid</parameter></term> | ||
<listitem> | ||
<simpara> | ||
If &null;, the current process ID is used. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
<varlistentry> | ||
<term><parameter>hmask</parameter></term> | ||
<listitem> | ||
<simpara> | ||
The cpu affinity mask comprised of one or more cpu id for binding the process to. | ||
</simpara> | ||
</listitem> | ||
</varlistentry> | ||
</variablelist> | ||
</refsect1> | ||
|
||
<refsect1 role="returnvalues"> | ||
&reftitle.returnvalues; | ||
<simpara> | ||
&return.success; | ||
</simpara> | ||
&return.falseproblem; | ||
</refsect1> | ||
|
||
<refsect1 role="errors"> | ||
&reftitle.errors; | ||
<simpara> | ||
A <classname>TypeError</classname> is thrown if one | ||
of the cpu id from the <parameter>hmask</parameter> is invalid. | ||
A <classname>ValueError</classname> is thrown if | ||
<parameter>pid</parameter> is an invalid process id | ||
or the cpu mask had failed to be created. | ||
</simpara> | ||
</refsect1> | ||
|
||
<refsect1 role="seealso"> | ||
&reftitle.seealso; | ||
<simplelist> | ||
<member><function>pcntl_setcpuaffinity</function></member> | ||
</simplelist> | ||
</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 | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters