The mvssigsetup callable service allows a task to catch or intercept signals. This service also allows a task to intercept cancellation and quiesce interrupts. Only one mvssigsetup service in a process can be active. If a second mvssigsetup service must be performed in a process, an mvsunsigsetup service must be performed on the thread that issued the mvssigsetup service request before the second invocation of the mvssigsetup service.
Both MVS™ task termination and the mvsprocclp service (BPX1MPC, BPX4MPC) perform the mvsunsigsetup service.
Operation | Environment |
---|---|
Authorization: | Problem program or supervisor state, PSW key when the process was created (not PSW key 0) |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1MSS): | 31-bit |
AMODE (BPX4MSS): | 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 BPX4MSS with the same parameters. The Signal_interface_routine_address parameter and the User_data parameter are doublewords.
The name of a fullword (doubleword) containing the address of the user-supplied signal interface routine (SIR) that gets control when a signal handler needs to be invoked. The signal handler is defined by the sigaction call; see sigaction (BPX1SIA, BPX4SIA) — Examine or change a signal action. You can also invoke the SIR to process a default signal action, depending on the values specified for Default_override_signal_set. See the usage note on using the upper bit of the SIR address for indirect signal handler addresses.
The name of a fullword (in 31–bit mode) or doubleword (in 64–bit mode) containing 4 or 8 bytes of user-supplied data that is passed to the signal interface routine on invocation from signal processing.
The name of an 8-byte area containing a 64-bit mask of signals that the SIR processes when their respective default actions take place. The leftmost bit represents signal number 1, and the rightmost bit represents signal number 64. The signals SIGSTOP, SIGDUMP, and SIGTRACE cannot be intercepted. The bit positions that represent these signals are ignored. Signal 64 represents cancellation or quiesce requests. For more information, see BPXYSIGH — Signal constants.
The name of an 8-byte area containing a 64-bit mask of signals specified in the Default_override_signal_set parameter that also causes the process to end. The leftmost bit represents signal number 1, and the rightmost bit represents signal number 64. When set to 1, the signal represented results in a task that is either stopped or in a wait state to be interrupted by the signal. It is up to the signal interface routine to end the process. The bit that represents signal 64 of this mask is reserved. For more information, see BPXYSIGH — Signal constants.
The name of a fullword in which the mvssigsetup service returns 0 if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EMVSINITIAL | The service failed. The following reason codes can accompany the return code: JRNotPRB, JRPSWKeyNotValid, and JRAlreadySigSetup. |
The name of a fullword in which the mvssigsetup service stores the reason code. The mvssigsetup 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 user-supplied signal interface routine (SIR) is given control when the current PSW key is equal to the signal delivery key for the process. The signal delivery key for the process is defined as the PSW key when the process was dubbed for the first request for a callable service. A process image that results after the exec service or the execmvs service always has a signal delivery key of 8 and is not set up for signals.
If the signal handler addresses specified on the call to sigaction are not the actual handler addresses but pointers to the handler addresses, turn on the upper bit of the SIR address supplied on this service to enable ptrace to set breakpoints at the beginning of the signal handlers.
For information about the BPXYPPSD macro, see BPXYPPSD — Map signal delivery data.
The SIR receives control with the following register interface:
Register | Contents |
---|---|
Reg 0 | 0 |
Reg 1 | Address of standard parameter list. PARM1= address of BPXYPPSD; Reg 1 = ADDR(PpsdSirPARMS). |
Regs 2–12 | 0 |
Reg 13 | 0 No save area for registers is provided to the SIR. The SIR does not save caller's registers. |
Reg 14 | 0 No return address. |
Reg 15 | Set to address of the SIR. |
The SIR receives control in the following system state:
Operation | Environment |
---|---|
Authorization: | Problem program state, PSW key when the process was created (not PSW key 0) |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE: | The same as the caller of mvssigsetup (BPX1MSS, BPX4MSS) |
ASC mode: | Primary mode |
Interrupt status: | Enabled for interrupts |
Locks: | Unlocked |
Signal mask: | All signals that may be blocked by the signal mask are blocked. |
The use of the Default_terminate_signal_set is to indicate to the kernel which signals intercepted by the SIR cause the process to end. For example, a user might wish to intercept the SIGUSR1 signal, but rather than performing the default of termination, the user might wish to have a message issued and then the signal thrown away (ignored). In this case, the user would turn the corresponding bit on in the Default_override_signal_set and off in the Default_terminate_signal_set. This bit set combination tells the kernel not to interrupt functions that return an EINTR.
See The relationship of z/OS UNIX signals to callable services.
For an example using this callable service, see BPX1MSS (mvssigsetup) example.