The setpgid callable service places a process in a process group. You identify the group by specifying a process group ID. You can assign a process to a different group, or you can start a new group with that process as its leader.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SPG): | 31-bit |
AMODE (BPX4SPG): | 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 BPX4SPG with the same parameters.
The name of a fullword that contains the ID of the process that is to be placed in the process group. If the ID is specified as 0, the system uses the process ID of the calling process.
The name of a fullword that contains the ID of the process group where Process_ID is assigned. If the ID is specified as 0, the system uses the process group ID that is indicated by the Process_ID parameter.
The name of a fullword in which the setpgid service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EACCES | The value of Process_ID matches the process ID of a child of the calling process, but the child has successfully invoked one of the exec functions. Access to the target process was denied. The following reason code can accompany the return code: JRExecAfterFork. |
EINVAL | The Process_group_ID parameter is less than zero or has some other unsupported value. The following reason codes can accompany the return code: JRNoSuchPid and JRPgidDifferentSession. |
EPERM | The calling process cannot change the process group ID of the specified process. The following reason codes can accompany the return code: JRPidEQSessLeader, JRPidDifferentSession, and JRPgidDifferentSession. |
ESRCH | The specified Process_ID is not that of the calling process or any of its children. The following reason codes can accompany the return code: JRNotDescendant and JRNoSuchPid. |
The name of a fullword in which the setpgid service stores the reason code. The setpgid 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.
See the conditions described under Return_code.
For an example using this callable service, see BPX1SPG (setpgid) example.