Signals
Signals are one of the oldest inter-process communication methods used by Unix TM systems. They are used to signal asynchronous events to one or more processes.
A signal could be generated by a keyboard interrupt or an error condition.
Signals are also used by programs to signal job control commands to their child processes.
There are a set of defined signals that the kernel can generate or that can be generated by other processes in the system:
1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP 6) SIGIOT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1 11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP 21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ 26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
Processes can choose to ignore most of the signals that are generated, with two notable exceptions:
The SIGSTOP signal which causes a process to halt its execution.
The SIGKILL signal which causes a process to exit can be ignored.
Processes can choose just how they want to handle the other signals:
They can block the signals.
Choose to handle them themselves.
Allow the kernel to handle them.
If the kernel handles the signals, it will do the default actions required for this signal: For example, the default action when a process receives the SIGFPE (floating point exception) signal is to core dump and then exit. The process modifies the default signal handling by making system calls and these calls alter the sigaction for the appropriate signal as well as the blocked mask.
Security Not every process in the system can send signals to every other process, the kernel can and super users can. Normal processes can only send signals to processes with the same uid and gid or to processes in the same process group1.
Signals are not presented to the process immediately they are generated, they must wait until the process is running again.