Signals and Exceptions in Unix/Linux

(10). Proper use of signals: Unix signals are originally designed for these purposes.

. As a unified treatment of process exceptions: When a process encounters an exception, it traps to kernel mode, converts the trap reason to a signal number and sends the signal to itself. If the exception occurred in kernel mode, the kernel prints a PANIC message and stops. If the exception occurred in user mode, the process typically terminates with a memory dump for debugging.

. To allow processes to handle program errors in user mode by preinstalled signal catchers. This is similar to the ESPIE macro in MVS [IBM MVS].

. Under unusual conditions, it allows a process to kill another process by a signal. Note that kill does not kill a process outright; it is only a “please die” plea to the target process. Why can’t we kill a process outright? The reader is encouraged to think of the reasons. (Hint: the large number of unclaimed anonymous accounts in Swiss banks).

Source: Wang K.C. (2018), Systems Programming in Unix/Linux, Springer; 1st ed. 2018 edition.

Leave a Reply

Your email address will not be published. Required fields are marked *