[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-doc-cvs
Subject:    [DOC-CVS] =?utf-8?q?svn:_/phpdoc/en/trunk/reference/posix/_constants.xml_functions/posix-getrlimit.x
From:       Adam_Harvey <aharvey () php ! net>
Date:       2015-09-21 12:18:09
Message-ID: svn-aharvey-1442837889-337883-1004611931 () svn ! php ! net
[Download RAW message or body]

aharvey                                  Mon, 21 Sep 2015 12:18:09 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=337883

Log:
Add posix_setrlimit() documentation.

Changed paths:
    U   phpdoc/en/trunk/reference/posix/constants.xml
    U   phpdoc/en/trunk/reference/posix/functions/posix-getrlimit.xml
    A   phpdoc/en/trunk/reference/posix/functions/posix-setrlimit.xml
    U   phpdoc/en/trunk/reference/posix/versions.xml


["svn-diffs-337883.txt" (text/x-diff)]

Modified: phpdoc/en/trunk/reference/posix/constants.xml
===================================================================
--- phpdoc/en/trunk/reference/posix/constants.xml	2015-09-21 12:18:03 UTC (rev 337882)
+++ phpdoc/en/trunk/reference/posix/constants.xml	2015-09-21 12:18:09 UTC (rev 337883)
@@ -125,6 +125,241 @@
    </varlistentry>
   </variablelist>
  </section>
+
+ <section xml:id="posix.constants.setrlimit">
+  <title><function>posix_setrlimit</function> constants</title>
+  <note>
+   <para>
+    These constants are available starting with PHP 7.0.0. Please note that
+    some of them may not be available on your system.
+   </para>
+  </note>
+  <note>
+   <para>
+    You may wish to read the below notes in conjunction with the manpage for
+    <function>setrlimit</function> on your specific operating system, as there
+    is variance in how these limits are interpreted, even across operating
+    systems that claim to implement POSIX in full.
+   </para>
+  </note>
+  <variablelist>
+   <varlistentry xml:id="constant.posix-rlimit-as">
+    <term>
+     <constant>POSIX_RLIMIT_AS</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of the process's address space in bytes. See also PHP's
+      <link linkend="ini.memory-limit">memory_limit</link> configuration
+      directive.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-core">
+    <term>
+     <constant>POSIX_RLIMIT_CORE</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of a core file. If the limit is set to 0, no core file
+      will be generated.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-cpu">
+    <term>
+     <constant>POSIX_RLIMIT_CPU</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum amount of CPU time that the process can use, in seconds.
+      When the soft limit is hit, a <literal>SIGXCPU</literal> signal will be
+      sent, which can be caught with <function>pcntl_signal</function>.
+      Depending on the operating system, additional <literal>SIGXCPU</literal>
+      signals may be sent each second until the hard limit is hit, at which
+      point an uncatchable <literal>SIGKILL</literal> signal is sent.
+     </simpara>
+     <simpara>
+      See also <function>set_time_limit</function>.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-data">
+    <term>
+     <constant>POSIX_RLIMIT_DATA</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of the process's data segment, in bytes. It is
+      extremely unlikely that this will have any effect on the execution of
+      PHP unless an extension is in use that calls <function>brk</function> or
+      <function>sbrk</function>.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-fsize">
+    <term>
+     <constant>POSIX_RLIMIT_FSIZE</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of files that the process can create, in bytes.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-locks">
+    <term>
+     <constant>POSIX_RLIMIT_LOCKS</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum number of locks that the process can create. This is only
+      supported on extremely old Linux kernels.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-memlock">
+    <term>
+     <constant>POSIX_RLIMIT_MEMLOCK</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum number of bytes that can be locked into memory.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-msgqueue">
+    <term>
+     <constant>POSIX_RLIMIT_MSGQUEUE</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum number of bytes that can be allocated for POSIX message
+      queues. PHP does not ship with support for POSIX message queues, so this
+      limit will not have any effect unless you are using an extension that
+      implements that support.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-nice">
+    <term>
+     <constant>POSIX_RLIMIT_NICE</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum value to which the process can be
+      <link linkend="function.pcntl-setpriority">reniced</link> to. The value
+      that will be used will be <literal>20 - limit</literal>, as resource
+      limit values cannot be negative.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-nofile">
+    <term>
+     <constant>POSIX_RLIMIT_NOFILE</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      A value one greater than the maximum file descriptor number that can be
+      opened by this process.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-nproc">
+    <term>
+     <constant>POSIX_RLIMIT_NPROC</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum number of processes (and/or threads, on some operating
+      systems) that can be created for the real user ID of the process.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-rss">
+    <term>
+     <constant>POSIX_RLIMIT_RSS</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of the process's resident set, in pages.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-rtprio">
+    <term>
+     <constant>POSIX_RLIMIT_RTPRIO</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum real time priority that can be set via the
+      <function>sched_setscheduler</function> and
+      <function>sched_setparam</function> system calls.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-rttime">
+    <term>
+     <constant>POSIX_RLIMIT_RTTIME</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum amount of CPU time, in microseconds, that the process can
+      consume without making a blocking system call if it is using real time
+      scheduling.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-sigpending">
+    <term>
+     <constant>POSIX_RLIMIT_SIGPENDING</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum number of signals that can be queued for the real user ID of
+      the process.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-stack">
+    <term>
+     <constant>POSIX_RLIMIT_STACK</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      The maximum size of the process stack, in bytes.
+     </simpara>
+    </listitem>
+   </varlistentry>
+   <varlistentry xml:id="constant.posix-rlimit-infinity">
+    <term>
+     <constant>POSIX_RLIMIT_INFINITY</constant>
+      (<type>integer</type>)
+    </term>
+    <listitem>
+     <simpara>
+      Used to indicate an infinite value for a resource limit.
+     </simpara>
+    </listitem>
+   </varlistentry>
+  </variablelist>
+ </section>
 </appendix>

 <!-- Keep this comment at the end of the file

Modified: phpdoc/en/trunk/reference/posix/functions/posix-getrlimit.xml
===================================================================
--- phpdoc/en/trunk/reference/posix/functions/posix-getrlimit.xml	2015-09-21 12:18:03 UTC (rev 337882)
+++ phpdoc/en/trunk/reference/posix/functions/posix-getrlimit.xml	2015-09-21 12:18:09 UTC (rev 337883)
@@ -156,23 +156,12 @@
   </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>
+    <member><function>posix_setrlimit</function></member>
    </simplelist>
   </para>
  </refsect1>

Added: phpdoc/en/trunk/reference/posix/functions/posix-setrlimit.xml
===================================================================
--- phpdoc/en/trunk/reference/posix/functions/posix-setrlimit.xml	                        (rev 0)
+++ phpdoc/en/trunk/reference/posix/functions/posix-setrlimit.xml	2015-09-21 12:18:09 UTC (rev 337883)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<refentry xml:id="function.posix-setrlimit" xmlns="http://docbook.org/ns/docbook">
+ <refnamediv>
+  <refname>posix_setrlimit</refname>
+  <refpurpose>Set system resource limits</refpurpose>
+ </refnamediv>
+
+ <refsect1 role="description">
+  &reftitle.description;
+  <methodsynopsis>
+   <type>bool</type><methodname>posix_setrlimit</methodname>
+   <methodparam><type>int</type><parameter>resource</parameter></methodparam>
+   <methodparam><type>int</type><parameter>softlimit</parameter></methodparam>
+   <methodparam><type>int</type><parameter>hardlimit</parameter></methodparam>
+  </methodsynopsis>
+  <para>
+   <function>posix_setrlimit</function> sets the soft and hard limits for a
+   given system resource.
+  </para>
+  &posix.rlimits;
+ </refsect1>
+
+ <refsect1 role="parameters">
+  &reftitle.parameters;
+  <para>
+   <variablelist>
+    <varlistentry>
+     <term><parameter>resource</parameter></term>
+     <listitem>
+      <para>
+       The
+       <link linkend="posix.constants.setrlimit">resource limit constant</link>
+       corresponding to the limit that is being set.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><parameter>softlimit</parameter></term>
+     <listitem>
+      <para>
+       The soft limit, in whatever unit the resource limit requires, or
+       <constant>POSIX_RLIMIT_INFINITY</constant>.
+      </para>
+     </listitem>
+    </varlistentry>
+    <varlistentry>
+     <term><parameter>hardlimit</parameter></term>
+     <listitem>
+      <para>
+       The hard limit, in whatever unit the resource limit requires, or
+       <constant>POSIX_RLIMIT_INFINITY</constant>.
+      </para>
+     </listitem>
+    </varlistentry>
+   </variablelist>
+  </para>
+ </refsect1>
+
+ <refsect1 role="returnvalues">
+  &reftitle.returnvalues;
+  <para>
+   &return.success;
+  </para>
+ </refsect1>
+
+ <refsect1 role="seealso">
+  &reftitle.seealso;
+  <para>
+   <simplelist>
+    <member>man page SETRLIMIT(2)</member>
+    <member><function>posix_getrlimit</function></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
+-->

Modified: phpdoc/en/trunk/reference/posix/versions.xml
===================================================================
--- phpdoc/en/trunk/reference/posix/versions.xml	2015-09-21 12:18:03 UTC (rev 337882)
+++ phpdoc/en/trunk/reference/posix/versions.xml	2015-09-21 12:18:09 UTC (rev 337883)
@@ -34,6 +34,7 @@
  <function name='posix_seteuid' from='PHP 4 &gt;= 4.0.2, PHP 5'/>
  <function name='posix_setgid' from='PHP 4, PHP 5'/>
  <function name='posix_setpgid' from='PHP 4, PHP 5'/>
+ <function name='posix_setrlimit' from='PHP 7'/>
  <function name='posix_setsid' from='PHP 4, PHP 5'/>
  <function name='posix_setuid' from='PHP 4, PHP 5'/>
  <function name='posix_strerror' from='PHP 4 &gt;= 4.2.0, PHP 5'/>
@@ -61,4 +62,4 @@
 vim600: syn=xml fen fdm=syntax fdl=2 si
 vim: et tw=78 syn=sgml
 vi: ts=1 sw=1
--->
\ No newline at end of file
+-->


-- 
PHP Documentation Commits Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic