sigwait(2) DG/UX R4.11MU05 sigwait(2)
NAME
sigwait - wait for an asynchronous signal
SYNOPSIS
#include <signal.h>
int sigwait(sigsett *set)
int sigsett *set
where:
set A pointer to a set of signals for which the caller will
wait.
DESCRIPTION
Sigwait chooses a pending signal from set, atomically clears it from
the set of pending signals for the process, and returns that signal
number. If no signal in set is pending at the time of the call, the
thread is suspended until one or more signals in set becomes pending.
Only a signal whose action is SIG_DFL or a signal handler will be
pended and cause the calling thread to wake up. The normal delivery
actions of the signal (either the default action or going to a
signal-catching function) will not occur, instead sigwait will return
with the signal number of the signal.
Set cannot include either SIGKILL or SIGSTOP. Set can include
signals whose action is SIG_IGN. However, since an ignored signal is
not pended, the thread will not be awakened for such a signal.
If more than one thread is using sigwait(2) to wait for the same
signal, one of those threads returns from sigwait(2) with the signal
number. Which thread returns from sigwait(2) if more than one signal
thread is waiting is unspecified.
RETURN VALUE
Upon successful completion, sigwait(2) returns the signal number of
the received signal. Otherwise, -1 is returned and errno is set to
indicate the error.
DIAGNOSTICS
If any of the following conditions occurs, sigwait(2) returns -1 and
sets errno to the corresponding value:
EINVAL The set argument contains either SIGKILL or SIGSTOP, or an
unsupported signal number.
NOTES
This implementation of sigwait is based on draft 6 of the POSIX
threads standard, then called 1003.4A, now called 1003.1C. In order
to ensure compatibility with the final version of the standard,
define the macro POSIX4ADRAFT6SOURCE (with #define or -D) where
<signal.h> is included and sigwait is used.
SEE ALSO
sigaction(2), sigprocmask(2), sigsuspend(2), pause(2), signal(2).
COPYRIGHTS
Portions of this text are reprinted from IEEE Std 1003.4a Draft 6,
Thread Extension for Portable Operating Systems© by the Institute of
Electrical and Electronics Engineers, Inc., with the permission of
the IEEE Standards Department. To purchase IEEE Standards, call
800-678-IEEE.
In the event of a discrepancy between the electronic and the printed
version, the printed version takes precedence.
Licensed material--property of copyright holder(s)