The sigtimedwait callable service suspends the invoking thread until either the specified timeout expires, or a signal specified in the signal set becomes pending, at either the process or the invoking thread. If a signal that is specified in the signal set is sent to the invoker of sigtimedwait, the value of that signal is returned to the invoker and the sigtimedwait service ends.
Operation | Environment |
---|---|
Authorization: | Supervisor state or problem state, PSW key when the process was created (not PSW key 0) |
Dispatchable unit mode: | Task |
Cross memory mode: | PASN = HASN |
AMODE (BPX1STW): | 31-bit |
AMODE (BPX4STW): | 64-bit |
ASC mode: | Primary address space control (ASC) 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 BPX4STW with the same parameters. All parameter addresses and addresses in parameter structures are doublewords.
The name of an 8-byte field area that contains a 64-bit signal mask that contains the set of signals that this task is to wait on. The leftmost bit represents signal 1, and the rightmost bit represents signal 64. Bits that are set to 1 represent signals that are waited on.
The name of a fullword (doubleword) that contains the address of user-supplied storage that is mapped by the BPXYSINF macro (see BPXYSINF — Map SIGINFO_T structure). If this address is nonzero, the sigtimedwait service uses this area to place additional signal information when a signal number is returned in Return_value. If this address is zero, or if an error is returned, no additional information is returned in this area.
The name of a fullword that contains the length of the user-supplied storage that is mapped by the BPXYSINF macro. If the address of Siginfo_ptr is zero, this parameter is ignored.
The name of a fullword that contains an unsigned integer representing the number of nanoseconds to be added to the value specified by the Seconds parameter. Nanoseconds can be any value greater than or equal to 0 and less than or equal to 1 000 000 000.
The name of a fullword in which the sigtimedwait service returns the signal if the request is successful, or -1 if it is not successful.
Return_code | Explanation |
---|---|
EINVAL | One or more of the parameters that were passed to this service are in error. The following reason codes unique to the sigtimedwait service can accompany the return code: JRNanoSecondsTooBig, JRInvalidSignal. |
EAGAIN | The service timed out before any of the specified signals became pending on the invoking thread. |
EINTR | The service received a signal that was not specified in the input signal mask. |
The name of a fullword in which the sigtimedwait service stores the reason code. The sigtimedwait 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 sigtimedwait service.
For an example using this callable service, see BPX1STW (sigtimedwait) example.