When is a signal generated When a process terminates abnormally it tries to send a signal indicating what went wrong. C programs and UNIX can catch these signals for diagnostics. Signals vs Interupts Signals are software generated interrupts that are sent to a process when a event occurs. Signals can be sent to a process when the system detects a software event.
Signals can also come directly from the kernel.
The system defines a set of signals that can be sent to a process. Signals are the software version of a hardware interupt. Just like a hardware interupt, a signal can be blocked from being delivered in the future. Most signals cause termination of the receiving process if no action is taken by the process in response to the signal. If pid is 0, the signal is sent to all processes, except system processes.