<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.pcntl.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.pcntl-setcpuaffinity.php',
    1 => 'pcntl_setcpuaffinity',
    2 => 'Set the cpu affinity of a process',
  ),
  'up' => 
  array (
    0 => 'ref.pcntl.php',
    1 => 'Функції PCNTL',
  ),
  'prev' => 
  array (
    0 => 'function.pcntl-rfork.php',
    1 => 'pcntl_rfork',
  ),
  'next' => 
  array (
    0 => 'function.pcntl-setpriority.php',
    1 => 'pcntl_setpriority',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/pcntl/functions/pcntl-setcpuaffinity.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.pcntl-setcpuaffinity" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">pcntl_setcpuaffinity</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">pcntl_setcpuaffinity</span> &mdash; <span class="dc-title">Set the cpu affinity of a process</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.pcntl-setcpuaffinity-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>pcntl_setcpuaffinity</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$pid</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$hmask</code><span class="initializer"> = ?</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="simpara">
   Sets the cpu affinity for the <code class="parameter">pid</code> with the cpu affinity mask given by
   <code class="parameter">hmask</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.pcntl-setcpuaffinity-parameters">
  <h3 class="title">Параметри</h3>
  <dl>
   
    <dt><code class="parameter">pid</code></dt>
    <dd>
     <span class="simpara">
      If <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>, the current process ID is used.
     </span>
    </dd>
   
   
    <dt><code class="parameter">hmask</code></dt>
    <dd>
     <span class="simpara">
      The cpu affinity mask comprised of one or more cpu id for binding the process to.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.pcntl-setcpuaffinity-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="simpara">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
  <div class="warning"><strong class="warning">Увага</strong><p class="simpara">Ця функція може
повертати як логічне <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, так і не логічне значення, яке прирівнюється до
<strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. Докладніше про це описано в розділі <a href="language.types.boolean.php" class="link">Логічні типи даних</a>. Для перевірки
значення, яке повертає ця функція, використовується <a href="language.operators.comparison.php" class="link">оператор ===</a>.</p></div>
 </div>


 <div class="refsect1 errors" id="refsect1-function.pcntl-setcpuaffinity-errors">
  <h3 class="title">Помилки/виключення</h3>
  <p class="simpara">
   A <span class="classname"><a href="class.typeerror.php" class="classname">TypeError</a></span> is thrown if one
   of the cpu id from the <code class="parameter">hmask</code> is invalid.
   A <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> is thrown if
   <code class="parameter">pid</code> is an invalid process id
   or the cpu mask had failed to be created.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.pcntl-setcpuaffinity-seealso">
  <h3 class="title">Прогляньте також</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.pcntl-getcpuaffinity.php" class="function" rel="rdfs-seeAlso">pcntl_getcpuaffinity()</a> - Get the cpu affinity of a process</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>