Signals are often described as “software interrupts.” The arrival
of a signal informs a process that some event or exceptional condition has
occurred. There are various types of signals, each of which identifies a
different event or condition. Each signal type is identified by a different
integer, defined with symbolic names of the form SIGxxxx.
Signals are sent to a process by the kernel, by another process,
or by the process itself. For example, the kernel may send a signal to a
process when one of the following occurs:
•
the user typed the
interrupt by Control-C on the keyboard;
•
one of the process’s
children has terminated;
•
a timer (alarm clock) set
by the process has expired; or
•
the process attempted to
access an invalid memory address.
Within the shell, the kill command can be used to send a signal to
a process. The kill() system call provides the same facility within programs.
When
a process receives a signal, it takes one of the following actions, depending
on the signal:
•
it ignores the signal;
•
it is killed by the signal;
or
•
it is suspended until later
being resumed by receipt of a special-purpose signal.
No comments:
Post a Comment