sigpause
Purpose
Atomically releases blocked signals and waits for an
interrupt.
Syntax
int sigpause (sigmask)
int sigmask;
Description
The sigpause system call sets the process's signal mask
to the value of the sigmask parameter and then and waits
for a signal to arrive. Upon return, the previous signal
mask is restored. The sigpause system call terminates by
being interrupted, returning -1, and setting errno to
EINTR.
The sigpause system call sets the signal mask and waits
for an interrupt as one atomic operation. This means
that signals cannot occur between the operations of
setting the mask and waiting for a signal. If a program
invokes the sigsetmask and pause system calls separately,
then a signal that occurs between these system calls
might not be noticed by pause.
In normal usage, a signal is blocked by using the
sigblock system call at the beginning of a critical
section. The process then determines whether there is
work for it to do. If no work is to be done, then the
process waits for work by calling sigpause with the mask
previously returned by sigblock.
Return Value
If the signal is caught by the calling process and
control is returned from the signal handler, then the
calling process resumes execution after the sigpause
system call, which always returns a value of -1 and sets
errno to EINTR.
Related Information
In this book: "pause," "sigblock," "signal,"
"sigsetmask," and "sigvec."