sigwait(3-thr) sigwait(3-thr)
NAME
sigwait - causes a thread to wait for an asynchronous signal
SYNOPSIS
#include <pthread.h>
int sigwait(sigsett *set);
PARAMETERS
set Set 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 sig-
nals 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 sigwait() is a cancellation point.
RETURN VALUES
Possible return values are as follows:
EINVAL One or more of the values specified by set is invalid.
EINVAL One or more of the values specified by set is not blocked.
EINVAL There are no values specified in set.
SEE ALSO
pause(2), sigpending(2), sigprocmask(2), pthreadcancel(3-thr),
pthreadsetasynccancel(3-thr), sigsetops(3C), signal(5).
Page 1 Reliant UNIX 5.44 Printed 11/98