SIGACTION(2)

NAME
sigwait - wait for a signal

SYNOPSIS
#include <signal.h>

int sigwait(set, sig)
sigset_t *set;
int *sig;

DESCRIPTION
Sigwait 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.

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 process address space.

SEE ALSO
sigprocmask(2)

STANDARDS
The sigwait function call conforms to IEEE Std1003.1-1998 (``POSIX'').