|
|
HP-UX Reference > Ssighold(2V)HP-UX 11i Version 2: December 2007 Update |
|
NAMEsigset(), sighold(), sigrelse(), sigignore(), sigpause() — signal management SYNOPSIS#include <signal.h> void (*sigset(int sig, void (*func)(int)))(int); int sighold(int sig); int sigrelse(int sig); int sigignore(int sig); int sigpause(int sig); DESCRIPTIONThe system defines a set of signals that can be delivered to a process. The set of signals is defined in signal(5), along with the meaning and side effects of each signal. An alternate mechanism for handling these signals is defined here. The facilities described here should not be used in conjunction with the other facilities described under signal(2), sigvector(2), sigblock(2), sigsetmask(2), sigpause(3C) and sigspace(2). sigset() allows the calling process to choose one of four ways to handle the receipt of a specific signal. sig specifies the signal and func specifies the choice. sig can be any one of the signals described under signal(5) except SIGKILL or SIGSTOP. func is assigned one of four values: SIG_DFL, SIG_IGN, SIG_HOLD, or a function address. The actions prescribed by SIG_DFL and SIG_IGN are described under signal(5). The action prescribed by SIG_HOLD and function address are described below:
sighold() holds the signal sig. sigrelse() restores the system signal action of sig to that specified previously by sigset(). sighold() and sigrelse() are used to establish critical regions of code. sighold() is analogous to raising the priority level and deferring or holding a signal until the priority is lowered by sigrelse(). sigignore() sets the action for signal sig to SIG_IGN (see signal(5)). sigpause() suspends the calling process until it receives an unblocked signal. If the signal sig is held, it is released before the process pauses. sigpause() is useful for testing variables that are changed when a signal occurs. For example, sighold() should be used to block the signal first, then test the variables. If they have not changed, call sigpause() to wait for the signal. RETURN VALUEUpon successful completion, sigset() returns the previous value of the system signal action for the specified signal sig. Otherwise, a value of SIG_ERR is returned and errno is set to indicate the error. SIG_ERR is defined in <signal.h>. For the other functions, a 0 value indicates that the call succeeded. A -1 return value indicates an error occurred and errno is set to indicate the reason. ERRORSsigset() fails and the system signal action for sig is not changed if any of the following occur:
sigset(), sighold(), sigrelse(), sigignore(), and sigpause() fail and the system signal action for sig is not changed if any of the following occur:
sigpause returns when the following occurs:
WARNINGSThese signal facilities should not be used in conjunction with bsdproc(3C), signal(2), sigvector(2), sigblock(2), sigsetmask(2), sigpause(3C) and sigspace(2). |
|