The setsid callable service creates a new session, with the calling process as its session leader. The caller becomes the group leader of a new process group.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, any PSW key |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1SSI): | 31-bit |
AMODE (BPX4SSI): | 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 BPX4SSI with the same parameters.
The name of a fullword to which, if successful, the setsid service returns the session or process group ID of the new group. The new session or group process ID is the same as the process ID of the caller.
If not successful in creating a new session, the setsid service returns -1 as the Session_ID value.
Return_code | Explanation |
---|---|
EPERM | The caller is already a process group leader, or the caller's process ID matches the process group ID of some other process. The following reason code can accompany the return code: JRCallerIsPgLeader. |
The name of a fullword in which the setsid service stores the reason code. The setsid service returns Reason_code only if Session_ID is -1. Reason_code further qualifies the Return_code value. For the reason codes, see z/OS UNIX System Services Messages and Codes.
The calling process does not have a controlling terminal.
The calling process must not already be a process group leader.
For an example using this callable service, see BPX1SSI (setsid) example.