1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207
|
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 297028 $ -->
<refentry xml:id="function.posix-getrlimit" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>posix_getrlimit</refname>
<refpurpose>Return info about system resource limits</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>posix_getrlimit</methodname>
<void/>
</methodsynopsis>
<para>
<function>posix_getrlimit</function> returns an <type>array</type>
of information about the current resource's soft and hard limits.
</para>
<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.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns an associative <type>array</type> of elements for each
limit that is defined. Each limit has a soft and a hard limit.
<table>
<title>List of possible limits returned</title>
<tgroup cols="2">
<thead>
<row>
<entry>Limit name</entry>
<entry>Limit description</entry>
</row>
</thead>
<tbody>
<row>
<entry>core</entry>
<entry>
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.
</entry>
</row>
<row>
<entry>totalmem</entry>
<entry>
The maximum size of the memory of the process, in bytes.
</entry>
</row>
<row>
<entry>virtualmem</entry>
<entry>
The maximum size of the virtual memory for the process, in bytes.
</entry>
</row>
<row>
<entry>data</entry>
<entry>
The maximum size of the data segment for the process, in bytes.
</entry>
</row>
<row>
<entry>stack</entry>
<entry>
The maximum size of the process stack, in bytes.
</entry>
</row>
<row>
<entry>rss</entry>
<entry>
The maximum number of virtual pages resident in RAM
</entry>
</row>
<row>
<entry>maxproc</entry>
<entry>
The maximum number of processes that can be created for the
real user ID of the calling process.
</entry>
</row>
<row>
<entry>memlock</entry>
<entry>
The maximum number of bytes of memory that may be locked into RAM.
</entry>
</row>
<row>
<entry>cpu</entry>
<entry>
The amount of time the process is allowed to use the CPU.
</entry>
</row>
<row>
<entry>filesize</entry>
<entry>
The maximum size of the data segment for the process, in bytes.
</entry>
</row>
<row>
<entry>openfiles</entry>
<entry>
One more than the maximum number of open file descriptors.
</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Example use of <function>posix_getrlimit</function></title>
<programlisting role="php">
<![CDATA[
<?php
$limits = posix_getrlimit();
print_r($limits);
?>
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Array
(
[soft core] => 0
[hard core] => unlimited
[soft data] => unlimited
[hard data] => unlimited
[soft stack] => 8388608
[hard stack] => unlimited
[soft totalmem] => unlimited
[hard totalmem] => unlimited
[soft rss] => unlimited
[hard rss] => unlimited
[soft maxproc] => unlimited
[hard maxproc] => unlimited
[soft memlock] => unlimited
[hard memlock] => unlimited
[soft cpu] => unlimited
[hard cpu] => unlimited
[soft filesize] => unlimited
[hard filesize] => unlimited
[soft openfiles] => 1024
[hard openfiles] => 1024
)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
This is a not POSIX function, but is common on BSD and System V
systems. If the system does not support this function, then it
will not be included at compile time. This may be checked with
<function>function_exists</function>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member>man page GETRLIMIT(2)</member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->
|