HP-UX Reference (11i v2 04/09) - 2 System Calls (vol 5)

s
signal(2) signal(2)
then test the variables. If they have not changed, call
sigpause() to wait for the signal.
Threads Considerations
The signal disposition (such as catch/ignore/default) established by
signal() is shared by all threads in
the process. Blocked signal masks are maintained by each thread.
If
signal() is used to set the signal disposition for sig to
SIG_IGN or to SIG_DFL for a signal whose
default action is to ignore the signal, any instances of sig pending on the process or any of the threads
will be discarded. The signals are discarded regardless of whether the signal is blocked by any of the
threads.
For more information regarding signals and threads, refer to signal (5).
EXAMPLES
The following call to
signal() sets up a signal-catching function for the
SIGINT signal:
void myhandler();
(void) signal(SIGINT, myhandler);
WARNINGS
signal() should not be used in conjunction with the facilities described under bsdproc (3C), sigac-
tion (2), sigset (3C), or sigvector (2).
signal() does not detect an invalid value for action , and if it does not equal SIG_DFL
or SIG_IGN,
or point to a valid function address, subsequent receipt of the signal sig causes undefined results.
AUTHOR
signal() was developed by HP, AT&T, and the University of California, Berkeley.
SEE ALSO
abort(3C), exec(2), exit(2), init(1M), kill(1), kill(2), lseek(2), pause(2), setjmp(3C), sigaction(2), signal(5),
sigvector(2), wait(2), waitid(2).
STANDARDS CONFORMANCE
signal(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, ANSI C
Section 2384 Hewlett-Packard Company 4 HP-UX 11i Version 2: September 2004