The getpgid callable service gets the process group ID of the process whose process ID is equal to the input process ID. If the input process ID is 0, getpgid returns the process group ID of the calling process.
Operation | Environment |
---|---|
Authorization: | Supervisor or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1GEP): | 31-bit |
AMODE (BPX4GEP): | 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 BPX4GEP with the same parameter.
The name of a fullword that contains the process ID for which to get the process group ID. If PID is 0, the process group ID of the calling process is returned.
The name of a fullword in which the getpgid service returns a process group ID or, if it is not successful, a -1.
Return_code | Explanation |
---|---|
EPERM | The process whose process ID is equal to PID is not in the same session as the calling process. |
ESRCH | There is no process with a process ID equal to PID. |
The name of a fullword in which the getpgid service stores the reason code. The getpgid 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.
There are no restrictions on the use of the getpgid service.
For an example using this callable service, see BPX1GEP (getpgid) example.