The getrusage callable service gets information about resources that are used by the calling process or its terminated and waited-for child processes.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GRU): | 31-bit |
AMODE (BPX4GRU): | 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 BPX4GRU with the same parameters.
Constant Name | Description |
---|---|
RUSAGE_SELF | Rusage for current process |
RUSAGE_CHILDREN | Rusage for terminated children |
The RUSAGE_ constants are defined in the BPXYCONS macro (see BPXYCONS — Constants used by services).
The name of an rusage structure that is to contain the values for resource usage. Macro BPXYRLIM defines the rusage structure (see BPXYRLIM — Map the rlimit, rusage, and timeval structures).
The name of a fullword in which the getrusage service returns a value of zero if it is successful, and -1 if it is not successful.
Return_code | Explanation |
---|---|
EINVAL | An incorrect Who value was specified. The following reason code can accompany the return code: JrInvalidWho. |
The name of a fullword in which the getrusage service stores the reason code. The getrusage 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.
Resource information returned for multithreaded processes may be inaccurate.
There are no restrictions on the use of the getrusage service.
For an example using this callable service, see BPX1GRU (getrusage) example.