Differences between current version and predecessor to the previous major change of getrlimit(2).
Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History
Newer page: | version 3 | Last edited on Tuesday, December 31, 2002 2:00:14 am | by PerryLorier | |
Older page: | version 1 | Last edited on Tuesday, June 4, 2002 12:23:41 am | by perry | Revert |
@@ -1,142 +1,69 @@
-GETRLIMIT
-!!!GETRLIMIT
-NAME
-SYNOPSIS
-DESCRIPTION
-RETURN VALUE
-ERRORS
-CONFORMING TO
-NOTE
-SEE ALSO
-----
!!NAME
-
-
-
getrlimit, getrusage, setrlimit
- get/set
resource limits and usage
+getrlimit - get resource limits
!!SYNOPSIS
+ __#include <sys/time.h>__
+ __#include <sys/resource.h>__
+ __#include <unistd.h>__
-__#include __
-#include __
-#include __
-
-
-
__int getrlimit (int__ ''resource''__, struct rlimit
-*__''rlim''__);
-int getrusage (int__ ''who''__, struct rusage
-*__''usage''__);
-int setrlimit (int__ ''resource''__, const struct
-
rlimit *__''rlim''__);__
+
__int getrlimit (int__ ''resource''__, struct rlimit *__''rlim''__);__
!!DESCRIPTION
+getrlimit(2) get resource limits respectively. ''resource'' should be one of:
+ __RLIMIT_CPU__ /* CPU time in seconds */
+ __RLIMIT_FSIZE__ /* Maximum filesize */
+ __RLIMIT_DATA__ /* max data size */
+ __RLIMIT_STACK__ /* max stack size */
+ __RLIMIT_CORE__ /* max core file size */
+ __RLIMIT_RSS__ /* max resident set size */
+ __RLIMIT_NPROC__ /* max number of processes */
+ __RLIMIT_NOFILE__ /* max number of open files */
+ __RLIMIT_MEMLOCK__ /* max locked-in-memory address space*/
+ __RLIMIT_AS__ /* address space (virtual memory) limit */
-__getrlimit
__ and
__setrlimit
__ get and set resource
-limits respectively
. ''resource'' should be one
-of:
+A resource may unlimited if you set the limit to
__RLIM
_INFINITY
__.
__RLIMIT_OFILE__ is the BSD name for __RLIMIT_NOFILE
__.
+The __rlimit__ structure is defined as follows:
-__RLIMIT_CPU__ /* CPU time in seconds */__
-RLIMIT_FSIZE__ /* Maximum filesize */
__
-RLIMIT
_DATA
__ /*
max data size */__
-RLIMIT_STACK__ /* max stack size */__
-RLIMIT_CORE__ /* max core file size */__
-RLIMIT_RSS__ /* max resident set size */__
-RLIMIT_NPROC__ /* max number of processes */__
-RLIMIT_NOFILE__ /* max number of open files */__
-RLIMIT_MEMLOCK__ /* max locked-in-memory address
-space*/__
-RLIMIT_AS__ /* address space (virtual memory) limit
-*/
+ struct rlimit {
+ rlim
_t rlim
_cur;
+ rlim
_t rlim
_max;
+ };
+ __getrusage__ returns the current resource usages, for a ''who'' of either __RUSAGE_SELF__ or __RUSAGE_CHILDREN.__
-A resource may unlimited if you set the limit to
-__RLIM
_INFINITY
__.
__RLIMIT
_OFILE
__ is the BSD name
-for
__RLIMIT
_NOFILE
__.
+ struct rusage {
+ struct timeval ru
_utime; /* user time used */
+ struct timeval ru
_stime; /* system time used */
+ long ru
_maxrss; /* maximum resident set size */
+ long ru
_ixrss; /* integral shared memory size */
+ long ru
_idrss; /* integral unshared data size */
+ long ru
_isrss; /* integral unshared stack size */
+ long ru
_minflt; /* page reclaims */
+ long ru
_majflt; /* page faults */
+ long ru
_nswap; /* swaps */
+ long ru
_inblock; /* block input operations */
+ long ru
_oublock; /* block output operations */
+ long ru
_msgsnd; /* messages sent */
+ long ru
_msgrcv; /* messages received */
+ long ru
_nsignals; /* signals received */
+ long ru
_nvcsw; /* voluntary context switches */
+ long ru_nivcsw; /* involuntary context switches */
+ };
+!!RETURN VALUE
-The __rlimit__ structure
is defined as follows
-:
+On success, zero
is returned. On error, -1 is returned, and ''errno'' is set appropriately.
-
-struct rlimit {
-rlim_t rlim_cur;
-rlim_t rlim_max;
-};
-
-
-__getrusage__ returns the current resource usages, for a
-''who'' of either __RUSAGE_SELF__ or
-__RUSAGE_CHILDREN.__
-
-
-struct rusage {
-struct timeval ru_utime; /* user time used */
-struct timeval ru_stime; /* system time used */
-long ru_maxrss; /* maximum resident set size */
-long ru_ixrss; /* integral shared memory size */
-long ru_idrss; /* integral unshared data size */
-long ru_isrss; /* integral unshared stack size */
-long ru_minflt; /* page reclaims */
-long ru_majflt; /* page faults */
-long ru_nswap; /* swaps */
-long ru_inblock; /* block input operations */
-long ru_oublock; /* block output operations */
-long ru_msgsnd; /* messages sent */
-long ru_msgrcv; /* messages received */
-long ru_nsignals; /* signals received */
-long ru_nvcsw; /* voluntary context switches */
-long ru_nivcsw; /* involuntary context switches */
-};
-!!RETURN VALUE
-
-
-On success, zero is returned. On error, -1 is returned, and
-''errno'' is set appropriately.
!!ERRORS
-
-
-__
EFAULT__
-
-
-
''rlim'' or ''usage
'' points outside the accessible
-
address space.
-
-
-__
EINVAL__
-
-
-__
getrlimit__ or __setrlimit__
is called with a bad
-
''resource'', or __getrusage__ is called with a bad
-''who''.
-
-
-__EPERM__
-
-
-A non-superuser tries to use __setrlimit()__ to increase
-the soft or hard limit above the current hard limit, or a
-superuser tries to increase RLIMIT_NOFILE above the current
-kernel maximum.
+;[
EFAULT]:
''rlim'' points outside the accessible address space.
+;[
EINVAL]:
getrlimit(2)
is called with a bad ''resource''
!!CONFORMING TO
-
-
SVr4, BSD 4.3
!!NOTE
+Including ''<sys/time.h>'' is not required these days, but increases portability. (Indeed, ''struct timeval'' is defined in ''<sys/time.h>''.)
+The above struct was taken from BSD 4.3 Reno. Not all fields are meaningful under Linux. Right now (Linux 2.4) only the fields __ru_utime__, __ru_stime__, __ru_minflt__, __ru_majflt__, and __ru_nswap__ are maintained.
-Including '''' is not required these
-days, but increases portability. (Indeed, ''struct
-timeval'' is defined in
-''''.)
-
-
-The above struct was taken from BSD 4.3 Reno. Not all fields
-are meaningful under Linux. Right now (Linux 2.4) only the
-fields __ru_utime__, __ru_stime__, __ru_minflt__,
-__ru_majflt__, and __ru_nswap__ are
-maintained.
!!SEE ALSO
-
-
quotactl(2), ulimit(3)
-----