[Lsb-messages] /var/www/bzr/lsb/devel/lsbspec r3934: add get/setrlimit manpage (bug 3251)

Mats Wichmann mats at linuxfoundation.org
Fri Sep 6 16:25:15 UTC 2013


------------------------------------------------------------
revno: 3934
committer: Mats Wichmann <mats at linuxfoundation.org>
branch nick: lsbspec
timestamp: Fri 2013-09-06 10:25:15 -0600
message:
  add get/setrlimit manpage (bug 3251)
added:
  LSB/generic/baselib/getrlimit.sgml
  LSB/generic/baselib/setrlimit.sgml
modified:
  LSB/generic/baselib/baselib.sgml
  LSB/generic/baselib/libc.sgml
-------------- next part --------------
=== modified file 'LSB/generic/baselib/baselib.sgml'
--- a/LSB/generic/baselib/baselib.sgml	2013-08-29 17:19:19 +0000
+++ b/LSB/generic/baselib/baselib.sgml	2013-09-06 16:25:15 +0000
@@ -425,7 +425,7 @@
 </ROW>
 <ROW>
 <ENTRY><indexterm><primary>getpriority</primary></indexterm>getpriority <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
-<ENTRY><indexterm><primary>getrlimit</primary></indexterm>getrlimit <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
+<ENTRY><indexterm><primary>getrlimit</primary></indexterm>getrlimit <LINK LINKEND="REFSTD.libc.2">[LSB]</LINK></ENTRY>
 <ENTRY><indexterm><primary>getrusage</primary></indexterm>getrusage <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 <ENTRY><indexterm><primary>getsid</primary></indexterm>getsid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 </ROW>
@@ -533,7 +533,7 @@
 </ROW>
 <ROW>
 <ENTRY><indexterm><primary>setreuid</primary></indexterm>setreuid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
-<ENTRY><indexterm><primary>setrlimit</primary></indexterm>setrlimit <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
+<ENTRY><indexterm><primary>setrlimit</primary></indexterm>setrlimit <LINK LINKEND="REFSTD.libc.2">[LSB]</LINK></ENTRY>
 <ENTRY><indexterm><primary>setrlimit64</primary></indexterm>setrlimit64 <LINK LINKEND="REFSTD.libc.1">[LFS]</LINK></ENTRY>
 <ENTRY><indexterm><primary>setsid</primary></indexterm>setsid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 </ROW>
@@ -4882,7 +4882,9 @@
 typedef struct {
     int count;
     wint_t value;
-} mbstate_t;
+} __mbstate_t;
+
+typedef __mbstate_t mbstate_t;
 </SCREEN>
 </SECT2>
 <!-- empty header file All/malloc.h -->
@@ -7831,7 +7833,12 @@
 #define RUSAGE_SELF	0
 #define RLIMIT_FSIZE	1
 #define RLIMIT_LOCKS	10
-#define RLIM_NLIMITS	11
+#define RLIMIT_SIGPENDING	11
+#define RLIMIT_MSGQUEUE	12
+#define RLIMIT_NICE	13
+#define RLIMIT_RTPRIO	14
+#define RLIMIT_RTTIME	15
+#define RLIM_NLIMITS	16
 #define RLIMIT_DATA	2
 #define RLIMIT_STACK	3
 #define RLIMIT_CORE	4
@@ -22140,6 +22147,150 @@
 </refentry>
 
 
+<refentry id="baselib-getrlimit-1">
+
+<refmeta>
+<refentrytitle>getrlimit, setrlimit</refentrytitle>
+<refmiscinfo>Base Libraries</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>getrlimit, setrlimit</refname>
+<refpurpose>get resource consumption limits</refpurpose>
+<indexterm id="ix-baselib-getrlimit-1">
+	<primary>getrlimit</primary></indexterm>
+<indexterm id="ix-baselib-setrlimit-1">
+	<primary>setrlimit</primary></indexterm>
+</refnamediv>
+
+<refsynopsisdiv>
+<funcsynopsis>
+<funcsynopsisinfo>
+#include &lt;sys/resource.h&gt;
+</funcsynopsisinfo><funcprototype>
+<funcdef>int
+<function>getrlimit</function>
+</funcdef>
+<paramdef>__rlimit_resource_t
+<parameter>__resource</parameter>
+</paramdef>
+<paramdef>struct rlimit *
+<parameter>__rlimits</parameter>
+</paramdef>
+</funcprototype>
+<funcprototype>
+<funcdef>int
+<function>setrlimit</function>
+</funcdef>
+<paramdef>__rlimit_resource_t
+<parameter>__resource</parameter>
+</paramdef>
+<paramdef>const struct rlimit *
+<parameter>__rlimits</parameter>
+</paramdef>
+</funcprototype>
+</funcsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+<title>Description</title>
+<para>
+<function>getrlimit</function> and <function>setrlimit</function>
+are as specified in <xref LINKEND=STD.SUSv4>, 
+but with differences as listed below. 
+</para>
+<refsect2 id='extra.resources'><title>Extra Resources</title>
+<para>These additional resources extend the list in <xref LINKEND=STD.SUSv4>.
+</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_NPROC</emphasis></term>
+  <listitem>
+<para> The maximum number of processes (or, more precisely on Linux,
+threads) that can be created for the real user ID of the calling
+process. Upon encountering this limit, <function>fork</function>
+shall fail with the error <errorcode>EAGAIN</errorcode>. </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_MEMLOCK</emphasis></term>
+  <listitem>
+<para> The maximum number of bytes of memory that may be
+locked into RAM.  In effect this limit is rounded down to the
+nearest multiple of the system page size. This limit affects
+<function>mlock</function> and <function>mlockall</function>, the
+<function>mmap</function> <constant>MAP_LOCKED</constant> operation and
+the <function>shmctl</function> <constant>SHM_LOCK</constant> operation.
+The <function>shmctl</function> <constant>SHM_LOCK</constant> locks are
+accounted for separately from the per-process memory locks established
+by <function>mlock</function>, <function>mlockall</function>, and
+<function>mmap</function> <constant>MAP_LOCKED</constant>. In the former
+case, the limit sets a maximum on the total bytes in shared memory
+segments (see <function>shmget</function>) that may be locked by the
+real user ID of the calling process.  A process can lock bytes up to
+this limit in each of these two categories.  </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_LOCKS</emphasis></term>
+  <listitem>
+<para> A limit on the combined number of <function>flock</function> locks 
+and <function>fcntl</function> leases that this process may establish.
+This limit is obsolete and should not be used; support depends heavily
+on the version of the operating system kernel. </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_RSS</emphasis></term>
+  <listitem>
+<para> Specifies the
+limit (in pages) of the process's resident set. This limit
+is obsolete and should not be used; support depends heavily
+on the version of the operating system kernel. It affects
+only calls to <function>madvise</function> specifying
+<constant>MADV_WILLNEED</constant>. </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</refsect2>
+<refsect2 id='extra.errors'><title>Extra Errors</title>
+<para>These additional error codes extend the list in <xref LINKEND=STD.SUSv4>.
+</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>EFAULT</emphasis></term>
+  <listitem>
+<para>
+A pointer argument points to a location outside  the  accessible
+address space.
+</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</refsect2>
+
+</refsect1>
+
+<!-- this describes pre-2.6.9 kernel differences - but that's
+     old enough that we think we can leave it out entirely.
+<refsect1>
+<title>Notes</title>
+<para> In the case of <constant>RLIMIT_MEMLOCK</constant>,
+application developers should be aware of some behavior
+changes over time when using a Linux kernel.  Prior to Linux
+2.6.9, <constant>RLIMIT_MEMLOCK</constant> did not affect the
+<function>shmctl</function> <constant>SHM_LOCK</constant> operation (see
+above for description). Additionally, prior to Linux 2.6.9 the limit
+controlled the amount of memory that could be locked by a privileged
+process. Since Linux 2.6.9, no limits are placed on the amount of memory
+that a privileged process may lock, and this limit instead governs the
+amount of memory that an unprivileged process may lock. </para>
+</refsect1>
+-->
+
+</refentry>
+
+
 <REFENTRY ID="baselib-getservbyname-r"> <REFMETA>
 <REFENTRYTITLE>getservbyname_r</REFENTRYTITLE>
 <REFMISCINFO>Base Libraries</REFMISCINFO>
@@ -27886,6 +28037,9 @@
 </REFENTRY>
 
 
+<!-- content in getrlimit.sgml -->
+
+
 <refentry id="baselib-setsockopt-2">
 
 <refmeta>

=== added file 'LSB/generic/baselib/getrlimit.sgml'
--- a/LSB/generic/baselib/getrlimit.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/baselib/getrlimit.sgml	2013-09-06 16:25:15 +0000
@@ -0,0 +1,142 @@
+<refentry id="baselib-getrlimit-1">
+
+<refmeta>
+<refentrytitle>getrlimit, setrlimit</refentrytitle>
+<refmiscinfo>Base Libraries</refmiscinfo>
+</refmeta>
+
+<refnamediv>
+<refname>getrlimit, setrlimit</refname>
+<refpurpose>get resource consumption limits</refpurpose>
+<indexterm id="ix-baselib-getrlimit-1">
+	<primary>getrlimit</primary></indexterm>
+<indexterm id="ix-baselib-setrlimit-1">
+	<primary>setrlimit</primary></indexterm>
+</refnamediv>
+
+<refsynopsisdiv>
+<funcsynopsis>
+<funcsynopsisinfo>
+#include &lt;sys/resource.h&gt;
+</funcsynopsisinfo><funcprototype>
+<funcdef>int
+<function>getrlimit</function>
+</funcdef>
+<paramdef>__rlimit_resource_t
+<parameter>__resource</parameter>
+</paramdef>
+<paramdef>struct rlimit *
+<parameter>__rlimits</parameter>
+</paramdef>
+</funcprototype>
+<funcprototype>
+<funcdef>int
+<function>setrlimit</function>
+</funcdef>
+<paramdef>__rlimit_resource_t
+<parameter>__resource</parameter>
+</paramdef>
+<paramdef>const struct rlimit *
+<parameter>__rlimits</parameter>
+</paramdef>
+</funcprototype>
+</funcsynopsis>
+</refsynopsisdiv>
+
+<refsect1>
+<title>Description</title>
+<para>
+<function>getrlimit</function> and <function>setrlimit</function>
+are as specified in <xref LINKEND=STD.SUSv4>, 
+but with differences as listed below. 
+</para>
+<refsect2 id='extra.resources'><title>Extra Resources</title>
+<para>These additional resources extend the list in <xref LINKEND=STD.SUSv4>.
+</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_NPROC</emphasis></term>
+  <listitem>
+<para> The maximum number of processes (or, more precisely on Linux,
+threads) that can be created for the real user ID of the calling
+process. Upon encountering this limit, <function>fork</function>
+shall fail with the error <errorcode>EAGAIN</errorcode>. </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_MEMLOCK</emphasis></term>
+  <listitem>
+<para> The maximum number of bytes of memory that may be
+locked into RAM.  In effect this limit is rounded down to the
+nearest multiple of the system page size. This limit affects
+<function>mlock</function> and <function>mlockall</function>, the
+<function>mmap</function> <constant>MAP_LOCKED</constant> operation and
+the <function>shmctl</function> <constant>SHM_LOCK</constant> operation.
+The <function>shmctl</function> <constant>SHM_LOCK</constant> locks are
+accounted for separately from the per-process memory locks established
+by <function>mlock</function>, <function>mlockall</function>, and
+<function>mmap</function> <constant>MAP_LOCKED</constant>. In the former
+case, the limit sets a maximum on the total bytes in shared memory
+segments (see <function>shmget</function>) that may be locked by the
+real user ID of the calling process.  A process can lock bytes up to
+this limit in each of these two categories.  </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_LOCKS</emphasis></term>
+  <listitem>
+<para> A limit on the combined number of <function>flock</function> locks 
+and <function>fcntl</function> leases that this process may establish.
+This limit is obsolete and should not be used; support depends heavily
+on the version of the operating system kernel. </para>
+  </listitem>
+  </varlistentry>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>RLIMIT_RSS</emphasis></term>
+  <listitem>
+<para> Specifies the
+limit (in pages) of the process's resident set. This limit
+is obsolete and should not be used; support depends heavily
+on the version of the operating system kernel. It affects
+only calls to <function>madvise</function> specifying
+<constant>MADV_WILLNEED</constant>. </para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</refsect2>
+<refsect2 id='extra.errors'><title>Extra Errors</title>
+<para>These additional error codes extend the list in <xref LINKEND=STD.SUSv4>.
+</para>
+<variablelist remap='TP'>
+  <varlistentry>
+  <term><emphasis remap='B'></emphasis> - <emphasis remap='B'>EFAULT</emphasis></term>
+  <listitem>
+<para>
+A pointer argument points to a location outside  the  accessible
+address space.
+</para>
+  </listitem>
+  </varlistentry>
+</variablelist>
+</refsect2>
+
+</refsect1>
+
+<!-- this describes pre-2.6.9 kernel differences - but that's
+     old enough that we think we can leave it out entirely.
+<refsect1>
+<title>Notes</title>
+<para> In the case of <constant>RLIMIT_MEMLOCK</constant>,
+application developers should be aware of some behavior
+changes over time when using a Linux kernel.  Prior to Linux
+2.6.9, <constant>RLIMIT_MEMLOCK</constant> did not affect the
+<function>shmctl</function> <constant>SHM_LOCK</constant> operation (see
+above for description). Additionally, prior to Linux 2.6.9 the limit
+controlled the amount of memory that could be locked by a privileged
+process. Since Linux 2.6.9, no limits are placed on the amount of memory
+that a privileged process may lock, and this limit instead governs the
+amount of memory that an unprivileged process may lock. </para>
+</refsect1>
+-->
+
+</refentry>

=== modified file 'LSB/generic/baselib/libc.sgml'
--- a/LSB/generic/baselib/libc.sgml	2013-08-29 17:19:19 +0000
+++ b/LSB/generic/baselib/libc.sgml	2013-09-06 16:25:15 +0000
@@ -356,7 +356,7 @@
 </ROW>
 <ROW>
 <ENTRY><indexterm><primary>getpriority</primary></indexterm>getpriority <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
-<ENTRY><indexterm><primary>getrlimit</primary></indexterm>getrlimit <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
+<ENTRY><indexterm><primary>getrlimit</primary></indexterm>getrlimit <LINK LINKEND="REFSTD.libc.2">[LSB]</LINK></ENTRY>
 <ENTRY><indexterm><primary>getrusage</primary></indexterm>getrusage <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 <ENTRY><indexterm><primary>getsid</primary></indexterm>getsid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 </ROW>
@@ -464,7 +464,7 @@
 </ROW>
 <ROW>
 <ENTRY><indexterm><primary>setreuid</primary></indexterm>setreuid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
-<ENTRY><indexterm><primary>setrlimit</primary></indexterm>setrlimit <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
+<ENTRY><indexterm><primary>setrlimit</primary></indexterm>setrlimit <LINK LINKEND="REFSTD.libc.2">[LSB]</LINK></ENTRY>
 <ENTRY><indexterm><primary>setrlimit64</primary></indexterm>setrlimit64 <LINK LINKEND="REFSTD.libc.1">[LFS]</LINK></ENTRY>
 <ENTRY><indexterm><primary>setsid</primary></indexterm>setsid <LINK LINKEND="REFSTD.libc.6">[SUSv4]</LINK></ENTRY>
 </ROW>
@@ -4813,7 +4813,9 @@
 typedef struct {
     int count;
     wint_t value;
-} mbstate_t;
+} __mbstate_t;
+
+typedef __mbstate_t mbstate_t;
 </SCREEN>
 </SECT2>
 <!-- empty header file All/malloc.h -->
@@ -7762,7 +7764,12 @@
 #define RUSAGE_SELF	0
 #define RLIMIT_FSIZE	1
 #define RLIMIT_LOCKS	10
-#define RLIM_NLIMITS	11
+#define RLIMIT_SIGPENDING	11
+#define RLIMIT_MSGQUEUE	12
+#define RLIMIT_NICE	13
+#define RLIMIT_RTPRIO	14
+#define RLIMIT_RTTIME	15
+#define RLIM_NLIMITS	16
 #define RLIMIT_DATA	2
 #define RLIMIT_STACK	3
 #define RLIMIT_CORE	4
@@ -10011,6 +10018,8 @@
 m4_define('getprotoent_r','1')
 m4_sinclude(m4_ifdef('getpwent_r','',getpwent_r.sgml))
 m4_define('getpwent_r','1')
+m4_sinclude(m4_ifdef('getrlimit','',getrlimit.sgml))
+m4_define('getrlimit','1')
 m4_sinclude(m4_ifdef('getservbyname_r','',getservbyname_r.sgml))
 m4_define('getservbyname_r','1')
 m4_sinclude(m4_ifdef('getservbyport_r','',getservbyport_r.sgml))
@@ -10133,6 +10142,8 @@
 m4_define('setgroups','1')
 m4_sinclude(m4_ifdef('sethostname','',sethostname.sgml))
 m4_define('sethostname','1')
+m4_sinclude(m4_ifdef('setrlimit','',setrlimit.sgml))
+m4_define('setrlimit','1')
 m4_sinclude(m4_ifdef('setsockopt','',setsockopt.sgml))
 m4_define('setsockopt','1')
 m4_sinclude(m4_ifdef('setstate_r','',setstate_r.sgml))

=== added file 'LSB/generic/baselib/setrlimit.sgml'
--- a/LSB/generic/baselib/setrlimit.sgml	1970-01-01 00:00:00 +0000
+++ b/LSB/generic/baselib/setrlimit.sgml	2013-09-06 16:25:15 +0000
@@ -0,0 +1,1 @@
+<!-- content in getrlimit.sgml -->



More information about the lsb-messages mailing list