signal.2 (2010 09)

s
signal(2) signal(2)
is executed for all other signals (see
exec).
Acceptable values for sig are described in signal (5).
Acceptable values for func are:
SIG_DFL Execute the default action, which varies depending on the signal. The default action
for most signals is to terminate the process (see signal (5)).
A pending signal is discarded (whether or not it is blocked) if action is set to
SIG_DFL
but the default action of the pending signal is to ignore the signal (as in the case of
SIGCLD).
SIG_IGN Ignore the signal.
When
signal() is called with action set to
SIG_IGN and an instance of the signal
sig is pending, the pending signal is discarded, whether or not it is blocked.
SIGKILL and SIGSTOP signals cannot be ignored.
address Catch the signal.
Upon receipt of signal sig, reset the value of action for the caught signal to
SIG_DFL
(except signals marked with "not reset when caught"; see signal (5)), call the signal-
catching function to which address points, and resume executing the receiving process
at the point where it was interrupted.
In HP-UX, the signal-catching function is called with the following three parameters:
sig The signal number.
code A word of information usually provided by the hardware.
scp A pointer to the machine-dependent structure sigcontext defined in
<signal.h>.
The pointer scp is valid only during the context of the signal-catching function. The
structure pointer scp is always defined.
The code word is always zero for all signals except
SIGILL and SIGFPE.For
SIGILL, code has the following values:
8 illegal instruction trap;
9 break instruction trap;
10 privileged operation trap;
11 privileged register trap.
For
SIGFPE, code has the following values:
12 overflow trap;
13 conditional trap;
14 assist exception trap;
22 assist emulation trap.
As defined by the IEEE POSIX Standard, HP-UX does not raise an exception on
floating-point divide by zero. The result of floating-point divide by zero is infinity
which can be checked by
isinf().
The signals
SIGKILL and SIGSTOP cannot be caught.
The
sigset() function is used to modify signal dispositions.
The sig argument specifies the signal, which may be any signal except
SIGKILL and SIGSTOP.
The disp argument specifies the signal’s disposition, which may be
SIG_DFL, SIG_IGN or the address of
a signal handler.
If disp is the address of a signal handler, the system will add sig to the calling process signal mask before
executing the signal handler. When the signal handler returns, the system will restore the calling pro-
cess signal mask to its state prior to the delivery of the signal.
If disp is equal to
SIG_HOLD, sig will be added to the calling process signal mask and sigs disposition
will remain unchanged.
If disp is not equal to
SIG_HOLD, sig will be removed from the calling process signal mask.
2 Hewlett-Packard Company 2 HP-UX 11i Version 3: September 2010