SIGWAIT(2) BSD Programmer's Manual SIGWAIT(2)NAMEsigwait - wait for a signal
SYNOPSIS
#include <signal.h>
int
sigwait(const sigset_t *set, int *sig);
DESCRIPTIONSigwait() checks for a pending signal in set, clears it from the set of
pending signals and returns the signal number in the location referenced
by sig. If more than one of the signals contained in set is pending then
sigwait() selects only one and acts upon it. If no signal contained in
set is pending, then sigwait() waits for a signal to arrive. All of the
signals contained in set should be blocked or unpredictable results may
occur.
If more than one thread is using sigwait() to wait for the same signal
then only one thread will return from sigwait() with the signal number.
RETURN VALUES
The sigwait() function returns 0 if successful and the signal number is
stored in the location referenced by sig.
ERRORS
The sigwait() function may return one of the following errors:
[EINVAL] The set argument contains an invalid or unsupported signal
number.
[EFAULT] Sig points to memory that is not a valid part of the pro-
cess address space.
SEE ALSOsigprocmask(2)BUGS
When using threads it is not possible to use sigwait() to wait for SIGAL-
RM.
The sigwait() call is from POSIX.1c. The analogous POSIX.1-1996 calls
are sigtimedwait() and sigwaitinfo(), but these are not yet supported.
BSDI BSD/OS November 15, 1999 1