Index of Section 3 Manual Pages
| Interix / SUA | sighold.3 | Interix / SUA |
sighold(3) sighold(3)
sigpause()
NAME
sighold(), sigignore(), sigpause(), sigrelse(), sigset() - System V signal
management routines
SYNOPSIS
#include
int sighold(int signum)
int sigignore(int signum)
int sigpause(int signum)
int sigrelse(int signum)
void (*sigset(int signum, void (*handler)(int)))(int);
DESCRIPTION
These functions provide a simplified form of signal management; they are
implemented using the sigaction(2) call.
The sigset(3) function modifies the handling of the signal specified by
signum. The signal may be any signal but SIGKILL and SIGSTOP. The handler
is SIG_DFL (default), SIG_IGN (ignore), SIG_HOLD (block signal), or a
pointer to a handler function. If handler points to a signal handler,
signum is added to the calling process' signal mask before executing the
handler. When the handler returns, the system restores the signal mask to
its previous state. If the handler is SIG_HOLD, sigset(3) adds the signal
to the process' signal mask but doesn't change how the signal is handled.
If the handler is SIG_DFL or SIG_IGN, the signal is removed from the
signal mask.
The sighold(3) function adds signum to the calling process' signal mask.
The sigrelse(3) function removes signum from the calling process' signal
mask.
The sigignore(3) function sets the disposition of signum to SIG_IGN.
The sigpause(3) function removes the signal signum from the process'
signal mask and then suspends the process until a signal is received.
RETURN VALUE
On success, sigset(3) returns the signal's previous disposition if the
signal is not currently blocked. It returns SIG_HOLD if the signal is
blocked. On failure, it returns SIG_ERR and sets errno to indicate the
error.
The sigpause(3) function suspends execution of the process until a signal
is received; then it returns -1 and sets errno to [EINTR].
The other functions return 0 on success. On failure, they return -1 and
set errno to indicate the error.
ERRORS
The functions can fail if:
[EINVAL]
The value of signum is an illegal signal number.
The sigset(3) and sigignore(3) calls will also fail if:
[EINVAL]
They attempt to catch a signal that cannot be caught, or to ignore a
signal that cannot be ignored.
NOTES
This implementation of sigpause(3) follows the behavior described in the
Single UNIX Specification, not BSD practice.
SEE ALSO
sigaction(2)
signal(2)
USAGE NOTES
All of these functions are thread safe.
The following functions are async-signal safe: sigpause, sigset. The
following functions are not async-signal safe: sighold, sigignore,
sigrelse.