<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.posix.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.posix-setuid.php',
    1 => 'posix_setuid',
    2 => 'Fixe l\'UID effective du processus courant',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'Fonctions POSIX',
  ),
  'prev' => 
  array (
    0 => 'function.posix-setsid.php',
    1 => 'posix_setsid',
  ),
  'next' => 
  array (
    0 => 'function.posix-strerror.php',
    1 => 'posix_strerror',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/posix/functions/posix-setuid.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-setuid" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_setuid</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_setuid</span> &mdash; <span class="dc-title">Fixe l&#039;UID effective du processus courant</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.posix-setuid-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_setuid</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$user_id</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Fixe l&#039;UID effective de l&#039;utilisateur du processus courant.
   Il faut avoir les privilèges nécessaires
   (traditionnellement ceux du root) sur le système
   pour le faire.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-setuid-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">user_id</code></dt>
     <dd>
      <p class="para">
       L&#039;ID de l&#039;utilisateur.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-setuid-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.posix-setuid-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>posix_setuid()</strong></span></strong></p>
    <div class="example-contents"><p>
     Cet exemple affiche l&#039;ID courant de l&#039;utilisateur et en modifie
     sa valeur.
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">posix_getuid</span><span style="color: #007700">().</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">; </span><span style="color: #FF8000">//10001<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">posix_geteuid</span><span style="color: #007700">().</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">; </span><span style="color: #FF8000">//10001<br /></span><span style="color: #0000BB">posix_setuid</span><span style="color: #007700">(</span><span style="color: #0000BB">10000</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">posix_getuid</span><span style="color: #007700">().</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">; </span><span style="color: #FF8000">//10000<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">posix_geteuid</span><span style="color: #007700">().</span><span style="color: #DD0000">"\n"</span><span style="color: #007700">; </span><span style="color: #FF8000">//10000<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.posix-setuid-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.posix-setgid.php" class="function" rel="rdfs-seeAlso">posix_setgid()</a> - Fixe le GID effectif du processus courant</span></li>
    <li><span class="function"><a href="function.posix-seteuid.php" class="function" rel="rdfs-seeAlso">posix_seteuid()</a> - Modifie l'identifiant d'utilisateur r&eacute;el (UID) du processus courant</span></li>
    <li><span class="function"><a href="function.posix-getuid.php" class="function" rel="rdfs-seeAlso">posix_getuid()</a> - Retourne l'ID de l'utilisateur du processus courant</span></li>
    <li><span class="function"><a href="function.posix-geteuid.php" class="function" rel="rdfs-seeAlso">posix_geteuid()</a> - Retourne l'UID effectif de l'utilisateur du processus courant</span></li>
   </ul>
  </p>
 </div>


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