sigwait(3)
NAME
sigwait - Causes a thread to wait for an asynchronous signal
SYNOPSIS
#include <pthread.h> int sigwait(
sigset_t *set);
PARAMETERS
setSet of pending signals upon which the calling thread will wait.
DESCRIPTION
This routine causes a thread to wait for an asynchronous signal. It atomically chooses a pending signal from set, atomically clears it from the system’s set of pending signals and returns that signal number. If no signal in set is pending at the time of the call, the thread is blocked until one or more signals becomes pending. The signals defined by set may be unblocked during the call to this routine and will be blocked when the thread returns from the call unless some other thread is currently waiting for one of those signals. A Thread must block the signals it waits for using sigprocmask() prior to calling this function. If more than one thread is using this routine to wait for the same signal, only one of these threads will return from this routine with the signal number. A call to sigwati() is a cancellation point.
RETURN VALUES
Possible return values are as follows:
| Return | Error | Description |
| Signal number | Successful completion. | |
| \-1 | [EINVAL] | One or more of the values specified by set is invalid. |
| \-1 | [EINVAL] | One or more of the values specified by set is not blocked. |
| \-1 | [EINVAL] | There are no values specified in set. |
RELATED INFORMATION
Functions: pthread_cancel(3), pthread_setasynccancel(3), sigsetops(3), sigprocmask(3), sigpending(3), pause(3),
Hewlett-Packard Company — OSF DCE 1.1/HP DCE 1.5