April 2004
Intermediate to advanced
736 pages
16h 19m
English
A signal is a notification that an event has occurred, such as a user typing an interrupt (Ctrl-c, normally), a floating-point exception, or an alarm going off. Usually, a signal is delivered to a process or thread asynchronously and whatever the process or thread is doing is interrupted. The signal might immediately terminate the process, or, by prearrangement, a function designated to catch it might be executed.
To show how a program handles a signal, here’s a simple example of a program that displays a number once every three seconds, but when an interrupt signal occurs, it displays a message and terminates:
The call to sigaction installed a signal-handling function ...
Read now
Unlock full access