The getrlimit callable service gets hard and soft resource limits for the calling process.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GRL): | 31-bit |
AMODE (BPX41GRL): | 64-bit |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Control parameters: | All parameters must be addressable by the caller and in the primary address space. |
|
AMODE 64 callers use BPX4GRL with the same parameters.
Constant Name | Description |
---|---|
RLIMIT_MEMLIMIT | Limit of 1-megabyte segments above the 2-gigabyte addressing range |
RLIMIT_CORE | Limit size of core dump |
RLIMIT_CPU | Limit CPU time per process |
RLIMIT_FSIZE | Limit file size |
RLIMIT_NOFILE | Limit number of open files |
RLIMIT_AS | Limit address space size |
The RLIMIT_ constants are defined in the BPXYCONS macro. (See BPXYCONS — Constants used by services.)
The name of an rlimit structure in which the hard (maximum) and soft (current) limit values for the resource that is identified by the resource parameter are to be placed. Macro BPXYRLIM defines the rlimit structure. (See BPXYRLIM — Map the rlimit, rusage, and timeval structures.) Each limit value contains two fullwords. For all resources except RLIMIT_FSIZE, the upper fullword for each limit value is set to zero before returning to the caller.
The name of a fullword in which the getrlimit service returns a value of zero if it is successful, and -1 if it is not successful.
Return_code | Explanation |
---|---|
EINVAL | An incorrect resource was specified. The following reason code can accompany the return code: JrInvalidResource. |
The name of a fullword in which the getrlimit service stores the reason code. The getrlimit service returns Reason_code only if Return_value is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
The current high-memory limit that is returned in RLIM_CUR_DW is the exact current memory limit. When the MEMLIMIT value is set by SMF, the maximum number of bytes that can be returned in RLIM_MAX_DW is X'FFFFFFFF00000000'. When the MEMLIMIT value is set by a z/OS UNIX service, the highest value that is supported is 16383 petabytes, or X'FFFC00000000000000'. It is therefore possible for the current MEMLIMIT to be larger than the maximum MEMLIMIT supported by z/OS UNIX System Services.
For an example using this callable service, see BPX1GRL (getrlimit) example.