uTools-Manuals/docs/php/posix_getrlimit.html
2019-04-28 19:00:34 +08:00

199 lines
6.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Return info about system resource limits</title>
</head>
<body class="docs"><div id="layout">
<div id="layout-content"><div id="function.posix-getrlimit" class="refentry">
<div class="refnamediv">
<h1 class="refname">posix_getrlimit</h1>
<p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">posix_getrlimit</span> &mdash; <span class="dc-title">Return info about system resource limits</span></p>
</div>
<div class="refsect1 description" id="refsect1-function.posix-getrlimit-description">
<h3 class="title">说明</h3>
<div class="methodsynopsis dc-description">
<span class="methodname"><strong>posix_getrlimit</strong></span>
( <span class="methodparam">void</span>
) : <span class="type">array</span></div>
<p class="para rdfs-comment">
<span class="function"><strong>posix_getrlimit()</strong></span> returns an <span class="type"><a href="language.types.array.html" class="type array">array</a></span>
of information about the current resource&#039;s soft and hard limits.
</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 returnvalues" id="refsect1-function.posix-getrlimit-returnvalues">
<h3 class="title">返回值</h3>
<p class="para">
Returns an associative <span class="type"><a href="language.types.array.html" class="type array">array</a></span> of elements for each
limit that is defined. Each limit has a soft and a hard limit.
<table class="doctable table">
<caption><strong>List of possible limits returned</strong></caption>
<thead>
<tr>
<th>Limit name</th>
<th>Limit description</th>
</tr>
</thead>
<tbody class="tbody">
<tr>
<td>core</td>
<td>
The maximum size of the core file. When 0, not core files are
created. When core files are larger than this size, they will
be truncated at this size.
</td>
</tr>
<tr>
<td>totalmem</td>
<td>
The maximum size of the memory of the process, in bytes.
</td>
</tr>
<tr>
<td>virtualmem</td>
<td>
The maximum size of the virtual memory for the process, in bytes.
</td>
</tr>
<tr>
<td>data</td>
<td>
The maximum size of the data segment for the process, in bytes.
</td>
</tr>
<tr>
<td>stack</td>
<td>
The maximum size of the process stack, in bytes.
</td>
</tr>
<tr>
<td>rss</td>
<td>
The maximum number of virtual pages resident in RAM
</td>
</tr>
<tr>
<td>maxproc</td>
<td>
The maximum number of processes that can be created for the
real user ID of the calling process.
</td>
</tr>
<tr>
<td>memlock</td>
<td>
The maximum number of bytes of memory that may be locked into RAM.
</td>
</tr>
<tr>
<td>cpu</td>
<td>
The amount of time the process is allowed to use the CPU.
</td>
</tr>
<tr>
<td>filesize</td>
<td>
The maximum size of the data segment for the process, in bytes.
</td>
</tr>
<tr>
<td>openfiles</td>
<td>
One more than the maximum number of open file descriptors.
</td>
</tr>
</tbody>
</table>
</p>
</div>
<div class="refsect1 examples" id="refsect1-function.posix-getrlimit-examples">
<h3 class="title">范例</h3>
<p class="para">
<div class="example" id="example-4347">
<p><strong>Example #1 Example use of <span class="function"><strong>posix_getrlimit()</strong></span></strong></p>
<div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /><br />$limits&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">posix_getrlimit</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$limits</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
</div>
<div class="example-contents"><p>以上例程的输出类似于:</p></div>
<div class="example-contents screen">
<div class="cdata"><pre>
Array
(
[soft core] =&gt; 0
[hard core] =&gt; unlimited
[soft data] =&gt; unlimited
[hard data] =&gt; unlimited
[soft stack] =&gt; 8388608
[hard stack] =&gt; unlimited
[soft totalmem] =&gt; unlimited
[hard totalmem] =&gt; unlimited
[soft rss] =&gt; unlimited
[hard rss] =&gt; unlimited
[soft maxproc] =&gt; unlimited
[hard maxproc] =&gt; unlimited
[soft memlock] =&gt; unlimited
[hard memlock] =&gt; unlimited
[soft cpu] =&gt; unlimited
[hard cpu] =&gt; unlimited
[soft filesize] =&gt; unlimited
[hard filesize] =&gt; unlimited
[soft openfiles] =&gt; 1024
[hard openfiles] =&gt; 1024
)
</pre></div>
</div>
</div>
</p>
</div>
<div class="refsect1 seealso" id="refsect1-function.posix-getrlimit-seealso">
<h3 class="title">参见</h3>
<p class="para">
<ul class="simplelist">
<li class="member">man page GETRLIMIT(2)</li>
<li class="member"><span class="function"><a href="posix_setrlimit.html" class="function" rel="rdfs-seeAlso">posix_setrlimit()</a> - Set system resource limits</span></li>
</ul>
</p>
</div>
</div></div></div></body></html>