HP-UX Reference (11i v1 00/12) - 2 System Calls (vol 5)
__________________________________________________________________________________________________________________________________________________________________________________________________
__________________________________________________________________________________________________________________________________________________________________________________________________
STANDARD Printed by: Nora Chuang [nchuang] STANDARD
/build/1111/BRICK/man2/!!!intro.2
________________________________________________________________
___ ___
s
signal(2) signal(2)
HP-UX EXTENSIONS
SYNOPSIS
void (*signal(int sig, void (*action)(int)))(int);
void (*sigset(int sig, void (*func)(int)))(int);
DESCRIPTION
The system defines a set of signals that can be delivered to a process. The set of signals is defined in sig-
nal(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 facili-
ties described under signal(2), sigvector(2), sigblock(2), sigsetmask(2), sigpause(3C), and sigspace(2).
Acceptable values for sig are defined in <signal.h>.
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.
The signal-catching function is called with the following three parameters:
sig The signal number.
code A word of information usuallyprovided 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(3M).
The signals SIGKILL and SIGSTOP cannot be caught.
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.
Section 2−−350 − 1 − HP-UX Release 11i: December 2000
___
___