Suspends a calling thread and waits for queued signals to arrive. This function is supported on OpenVMS Integrity servers and Alpha only. Format #include <signal.h> int sigwait (const sigset_t set, int *sig);
1 – Arguments
set The set of signals to wait for. sig Returns the signal number of the selected signal.
2 – Description
The sigwait function suspends the calling thread until at least one of the signals in the set argument is in the caller's set of pending signals. When this happens, one of those signals is automatically selected and removed from the set of pending signals. The signal number identifying that signal is then returned in the location referenced by sig. The effect is unspecified if any signals in the set argument are not blocked when the sigwait function is called. The set argument is created using the set manipulation functions sigemptyset, sigfillset, sigaddset, and sigdelset. If, while the sigwait function is waiting, a signal occurs that is eligible for delivery (that is, not blocked by the signal mask), that signal is handled asynchronously and the wait is interrupted. See also sigtimedwait and sigwaitinfo. See the "Error and Signal Handling" chapter of the VSI C RTL Reference Manual for more information on signal handling.
3 – Return Values
0 Upon successful completion, sigwait stores the signal number of the received signal at the location referenced by sig and returns 0. nonzero Indicates that an error occurred; errno is set to the following value: o EINVAL - The set argument contains an invalid or unsupported signal number.