signal - Modifies signal functions
void (*function)(int)) (int)
Interfaces documented on this reference page conform to industry standards as follows:
signal(): XPG4, XPG4-UNIX
Refer to the
reference page for more information
about industry standards and associated tags.
Defines the signal. All signals are valid with the exception
of SIGKILL and SIGSTOP.
Specifies the address of a signal handler.
The signal function provides compatibility for older versions of the operating system whose function is a subset of the sigaction function. The signal function sets the action associated with a signal. The function parameter uses the values SIG_DFL, SIG_IGN, or it can point to an address of a signal handler.
A SIG_DFL value specifies the default action that is to be taken when
the signal is delivered. A value of SIG_IGN specifies that the signal has
no effect on the receiving process. A pointer to a function requests that
the signal be caught; that is, the signal should cause the function to be
called. These actions are more fully described in the
The sigaction() function provides a more comprehensive and reliable mechanism for controlling signals and is recommended instead of signal() for new applications.
[Compaq] The effect of calling the signal function behavior differs depending on whether the calling program is linked with either of the special libraries, libbsd or libsys5, which supply BSD or System V signaling characteristics respectively. If neither library is used, the behavior is the same as that of the sigaction function with all the flags set to 0 (zero). If the libsys5 library is used (through compilation with the -lsys5 switch), then the specified signal is not blocked from delivery when the handler is entered, and the disposition of the signal reverts to SIG_DFL when the signal is delivered. If the libbsd library or the bsd_signal() function is used, the behavior is the same as that of the sigaction() function with the SA_RESTART flag set.
[Compaq] When compiled
in the X/Open UNIX environment, calls to the
are internally renamed by prepending
to the function
name. When you are debugging a module that includes the
version of the
function and for which
has been defined, use
to refer to the
information on when the
Upon successful completion of the
the value of the previous signal action is returned. Otherwise, SIG_ERR is
is set to indicate the error.
to the specified values for the following conditions:
parameter is not a valid signal
number or an attempt was made to catch a signal that cannot be caught or to
ignore a signal that cannot be ignored.
Functions: acct(2), bsd_signal(2), exit(2), kill(2), pause(3), ptrace(2), setjmp(3), sigaction(2), sigblock(2), sigpause(3), sigprocmask(2), sigstack(2), sigsuspend(2), sigvec(2), umask(2), wait(2)