Chapter Contents |
Previous |
Next |
getrlimit |
Portability: | UNIX compatible |
SYNOPSIS | |
DESCRIPTION | |
RETURN VALUE | |
USAGE NOTES | |
RELATED FUNCTIONS |
SYNOPSIS |
#include <sys/resource.h> int getrlimit(int resource, struct rlimit *info);
DESCRIPTION |
The getrlimitgetrlimit function determines the resource limits for the calling process. The limits are expressed as a pair of integers, a soft limit and a hard limit. The soft limit controls the amount of the resource the program is actually allowed to consume, while the hard limit specifies an upper bound on the soft limit. The soft limit can be raised up to the hard limit value, but the hard limit can only be raised by a privileged (superuser) caller.
The info
argument is a pointer to a structure
of type struct
rlimit
,
into which will be stored the defined limits. The structure contains the following
fields:
rlim_cur |
the current (i.e., soft) limit |
rlim_max |
the maximum limit |
The resource
argument defines the resource
to which the limit applies. It should be specified as one of the symbolic
values defined below.
RLIMIT_AS
RLIMIT_CORE
RLIMIT_CPU
RLIMIT_DATA
malloc
or calloc
.
This limit is not enforced under UNIX System Services OS/390, and an attempt
to set the limit lower than RLIM_INFINITY
will
be rejected.
RLIMIT_FSIZE
RLIMIT_NOFILE
RLIMIT_STACK
RLIM_INFINITY
will
be rejected.
RETURN VALUE |
getrlimit
returns 0
if successful, or -1
if
unsuccessful.
USAGE NOTES |
The getrlimit
function
can only be used with MVS 5.2.2 or a later release.
Note: Resource limits
are inherited from the parent process when fork
or exec
is used.
RELATED FUNCTIONS |
setrlimit
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.