Table of Contents
lpfN*funcrplprp
This facility is a simplified interface to
the more general facility. Signals allow the manipulation of a process
from outside its domain as well as allowing the process to manipulate itself
or copies of itself (children). There are two general types of signals:
those that cause termination of a process and those that do not. Signals
which cause termination of a program might result from an irrecoverable
error or might be the result of a user at a terminal typing the ‘interrupt’
character. Signals are used when a process is stopped because it wishes
to access its control terminal while in the background (see Signals are
optionally generated when a process resumes after being stopped, when the
status of child processes changes, or when input is ready at the control
terminal. Most signals result in the termination of the process receiving
them if no action is taken; some signals instead cause the process receiving
them to be stopped, or are simply discarded if the process has not requested
otherwise. Except for the and signals, the function allows for a signal
to be caught, to be ignored, or to generate an interrupt. These signals
are defined in the file call (formerly is possible
on a descriptor (see The procedure allows a user to choose
the action upon receipt of a signal. To set the default action of the signal
to occur as listed above, should be A resets the default action. To ignore
the signal should be This will cause subsequent instances of the signal
to be ignored and pending instances to be discarded. If is not used, further
occurrences of the signal are automatically blocked and is called. The
handled signal is unblocked with the function returns and the process continues
from where it left off when the signal occurred. Unlike previous signal
facilities, the handler func() remains installed after a signal has been
delivered. For some system calls, if a signal is caught while the call
is executing and the call is prematurely terminated, the call is automatically
restarted. (The handler is installed using the flag with The affected
system calls include and on a communications channel or a low speed
device and during a or However, calls that have already committed are
not restarted, but instead return a partial success (for example, a short
read count). When a process which has installed signal handlers forks,
the child process inherits the signals. All caught signals may be reset
to their default action by a call to the function; ignored signals remain
ignored.
The previous action is returned on a successful call.
Otherwise, -1 is returned and the global variable is set to indicate the
error.
will fail and no action will take place if one of the following
occur: is not a valid signal number. An attempt is made to ignore or
supply a handler for or
This facility appeared
in
Table of Contents