Index of Section 2 Manual Pages
| Interix / SUA | sigwait.2 | Interix / SUA |
sigwait(2) sigwait(2)
sigwait()
NAME
sigwait() - wait for a pending signal
SYNOPSIS
#include
int sigwait(const sigset_t *set, int *sig)
DESCRIPTION
The sigwait(2) function selects a pending signal in the signal set
referenced by the set argument, clears the signal from the set, and stores
the number of the signal in the location referenced by the sig argument
before returning. If set does not contain a pending signal, then
sigwait(2) suspends the calling thread or process until at least one
pending signal is added to the set.
If multiple threads are suspended by sigwait(2) waiting for the same
signal, sigwait(2) returns the number of the signal to only one thread.
RETURN VALUE
Upon successful completion, the sigwait(2) function returns 0 and stores
the signal number of the pending signal that it cleared from the signal
set in sig. Otherwise, it returns -1 and sets errno to indicate the error.
ERRORS
The sigwait(2) function can fail for the following reason:
[EINTR]
The wait was interrupted by an unblocked caught signal.
[EINVAL]
The signal set referenced by set contains an invalid or illegal signal
number.
SEE ALSO
pause(2)
pthread_sigmask(2)
sigaction(2)
signal(2)
sigpending(2)
sigprocmask(2)
sigsuspend(2)
USAGE NOTES
The sigwait function is thread safe.
The sigwait function is not async-signal safe.