Signals generally represent situations where the program has either been requested to terminate or an unrecoverable error has happened, therefore handling a signal allows for either perform pre-termination cleanup operations or try to recover from the error in some way.
Not all running environments are required to generate automatic signals in the cases for which they are designed in the standard C library, and some other environments not only generate these but also many more specific signals. But in any case, all signals generated explicitly with a call to function raise are delivered to its corresponding signal handler.
The C header signal.h includes the following functions:
|signal||Set function to handle signal (function)|
|raise||Generates a signal (function)|
It also declares the following type:
|sig_atomic_t||Integral type (type)|
And several macro contant values: SIGABRT, SIGILL, SIGSEGV, SIG_DFL, SIG_IGN, SIGFPE, SIGINT, SIGTERM and SIG_ERROR (explained in signal).