Skip to content

Commit 47fe8da

Browse files
committed
[PHP 8.4] pcntl add cpu affinity calls.
1 parent 8bf3587 commit 47fe8da

File tree

3 files changed

+161
-0
lines changed

3 files changed

+161
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<refentry xml:id="function.pcntl-getcpuaffinity" xmlns="http://docbook.org/ns/docbook">
4+
<refnamediv>
5+
<refname>pcntl_getcpuaffinity</refname>
6+
<refpurpose>Get the cpu affinity of a process</refpurpose>
7+
</refnamediv>
8+
9+
<refsect1 role="description">
10+
&reftitle.description;
11+
<methodsynopsis>
12+
<type class="union"><type>bool</type><type>array</type></type><methodname>pcntl_getcpuaffinity</methodname>
13+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>pid</parameter><initializer>&null;</initializer></methodparam>
14+
</methodsynopsis>
15+
<para>
16+
<function>pcntl_getcpuaffinity</function> gets the cpu affinity
17+
<parameter>pid</parameter>.
18+
</para>
19+
</refsect1>
20+
21+
<refsect1 role="parameters">
22+
&reftitle.parameters;
23+
<para>
24+
<variablelist>
25+
<varlistentry>
26+
<term><parameter>pid</parameter></term>
27+
<listitem>
28+
<para>
29+
If &null;, the process id of the current process is used.
30+
</para>
31+
</listitem>
32+
</varlistentry>
33+
</variablelist>
34+
</para>
35+
</refsect1>
36+
37+
<refsect1 role="returnvalues">
38+
&reftitle.returnvalues;
39+
<para>
40+
<function>pcntl_getcpuaffinity</function> returns the cpu affinity mask of
41+
the process or &false; on error.
42+
</para>
43+
&return.falseproblem;
44+
</refsect1>
45+
46+
<refsect1 role="seealso">
47+
&reftitle.seealso;
48+
<para>
49+
<simplelist>
50+
<member><function>pcntl_setcpuaffinity</function></member>
51+
</simplelist>
52+
</para>
53+
</refsect1>
54+
55+
</refentry>
56+
<!-- Keep this comment at the end of the file
57+
Local variables:
58+
mode: sgml
59+
sgml-omittag:t
60+
sgml-shorttag:t
61+
sgml-minimize-attributes:nil
62+
sgml-always-quote-attributes:t
63+
sgml-indent-step:1
64+
sgml-indent-data:t
65+
indent-tabs-mode:nil
66+
sgml-parent-document:nil
67+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
68+
sgml-exposed-tags:nil
69+
sgml-local-catalogs:nil
70+
sgml-local-ecat-files:nil
71+
End:
72+
vim600: syn=xml fen fdm=syntax fdl=2 si
73+
vim: et tw=78 syn=sgml
74+
vi: ts=1 sw=1
75+
-->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!-- $Revision$ -->
3+
<refentry xml:id="function.pcntl-setcpuaffinity" xmlns="http://docbook.org/ns/docbook">
4+
<refnamediv>
5+
<refname>pcntl_setcpuaffinity</refname>
6+
<refpurpose>Set the cpu affinity of a process</refpurpose>
7+
</refnamediv>
8+
9+
<refsect1 role="description">
10+
&reftitle.description;
11+
<methodsynopsis>
12+
<type>bool</type><methodname>pcntl_setcpuaffinity</methodname>
13+
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>pid</parameter><initializer>&null;</initializer></methodparam>
14+
<methodparam choice="opt"><type>array</type><parameter>hmask</parameter></methodparam>
15+
</methodsynopsis>
16+
<para>
17+
<function>pcntl_setcpuaffinity</function> sets the cpu affinity
18+
<parameter>pid</parameter> with the cpu affinity mask <parameter>hmask</parameter>.
19+
</para>
20+
</refsect1>
21+
22+
<refsect1 role="parameters">
23+
&reftitle.parameters;
24+
<para>
25+
<variablelist>
26+
<varlistentry>
27+
<term><parameter>pid</parameter></term>
28+
<listitem>
29+
<para>
30+
If &null;, the process id of the current process is used.
31+
</para>
32+
</listitem>
33+
</varlistentry>
34+
<varlistentry>
35+
<term><parameter>hmask</parameter></term>
36+
<listitem>
37+
<para>
38+
The cpu affinity mask comprised of 1 or more cpu id for binding the process to.
39+
</para>
40+
</listitem>
41+
</varlistentry>
42+
</variablelist>
43+
</para>
44+
</refsect1>
45+
46+
<refsect1 role="returnvalues">
47+
&reftitle.returnvalues;
48+
<para>
49+
<function>pcntl_setcpuaffinity</function> returns &true; if the cpu binding
50+
is successful or &false; on error.
51+
</para>
52+
&return.falseproblem;
53+
</refsect1>
54+
55+
<refsect1 role="seealso">
56+
&reftitle.seealso;
57+
<para>
58+
<simplelist>
59+
<member><function>pcntl_setcpuaffinity</function></member>
60+
</simplelist>
61+
</para>
62+
</refsect1>
63+
64+
</refentry>
65+
<!-- Keep this comment at the end of the file
66+
Local variables:
67+
mode: sgml
68+
sgml-omittag:t
69+
sgml-shorttag:t
70+
sgml-minimize-attributes:nil
71+
sgml-always-quote-attributes:t
72+
sgml-indent-step:1
73+
sgml-indent-data:t
74+
indent-tabs-mode:nil
75+
sgml-parent-document:nil
76+
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
77+
sgml-exposed-tags:nil
78+
sgml-local-catalogs:nil
79+
sgml-local-ecat-files:nil
80+
End:
81+
vim600: syn=xml fen fdm=syntax fdl=2 si
82+
vim: et tw=78 syn=sgml
83+
vi: ts=1 sw=1
84+
-->

reference/pcntl/versions.xml

+2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
<function name="pcntl_errno" from="PHP 5 &gt;= 5.3.4, PHP 7, PHP 8"/>
1010
<function name="pcntl_exec" from="PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8"/>
1111
<function name="pcntl_fork" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
12+
<function name="pcntl_getcpuaffinity" from="PHP 8 &gt;= 8.4.0"/>
1213
<function name="pcntl_getpriority" from="PHP 5, PHP 7, PHP 8"/>
1314
<function name="pcntl_get_last_error" from="PHP 5 &gt;= 5.3.4, PHP 7, PHP 8"/>
1415
<function name="pcntl_rfork" from="PHP 8 &gt;= 8.1.0"/>
16+
<function name="pcntl_setcpuaffinity" from="PHP 8 &gt;= 8.4.0"/>
1517
<function name="pcntl_setpriority" from="PHP 5, PHP 7, PHP 8"/>
1618
<function name="pcntl_signal" from="PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8"/>
1719
<function name="pcntl_signal_dispatch" from="PHP 5 &gt;= 5.3.0, PHP 7, PHP 8"/>

0 commit comments

Comments
 (0)