<?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 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.posix-setrlimit.php',
    1 => 'posix_setrlimit',
    2 => 'Set system resource limits',
  ),
  'up' => 
  array (
    0 => 'ref.posix.php',
    1 => 'POSIX 函数',
  ),
  'prev' => 
  array (
    0 => 'function.posix-setpgid.php',
    1 => 'posix_setpgid',
  ),
  'next' => 
  array (
    0 => 'function.posix-setsid.php',
    1 => 'posix_setsid',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/posix/functions/posix-setrlimit.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.posix-setrlimit" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">posix_setrlimit</h1>
  <p class="verinfo">(PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">posix_setrlimit</span> &mdash; <span class="dc-title">Set system resource limits</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.posix-setrlimit-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>posix_setrlimit</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$resource</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$soft_limit</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$hard_limit</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>posix_setrlimit()</strong></span> sets the soft and hard limits for a
   given system resource.
  </p>
  
<p class="para">
  Each resource has an associated soft and hard limit.  The soft
  limit is the value that the kernel enforces for the corresponding
  resource.  The hard limit acts as a ceiling for the soft limit.
  An unprivileged process may only set its soft limit to a value
  from 0 to the hard limit, and irreversibly lower its hard limit.
</p>

 </div>


 <div class="refsect1 parameters" id="refsect1-function.posix-setrlimit-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">resource</code></dt>
     <dd>
      <p class="para">
       The
       <a href="posix.constants.setrlimit.php" class="link">resource limit constant</a>
       corresponding to the limit that is being set.
      </p>
     </dd>
    
    
     <dt><code class="parameter">soft_limit</code></dt>
     <dd>
      <p class="para">
       The soft limit, in whatever unit the resource limit requires, or
       <strong><code><a href="posix.constants.setrlimit.php#constant.posix-rlimit-infinity">POSIX_RLIMIT_INFINITY</a></code></strong>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">hard_limit</code></dt>
     <dd>
      <p class="para">
       The hard limit, in whatever unit the resource limit requires, or
       <strong><code><a href="posix.constants.setrlimit.php#constant.posix-rlimit-infinity">POSIX_RLIMIT_INFINITY</a></code></strong>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.posix-setrlimit-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   成功时返回 <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>


 <div class="refsect1 seealso" id="refsect1-function.posix-setrlimit-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li>man page SETRLIMIT(2)</li>
    <li><span class="function"><a href="function.posix-getrlimit.php" class="function" rel="rdfs-seeAlso">posix_getrlimit()</a> - Return info about system resource limits</span></li>
   </ul>
  </p>
 </div>


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