next up previous contents index
Next: Send signal Up: Specify signal handling Previous: Specify signal handling

The signal function

When a signal occurs the normal flow of control of a program is interrupted. If a signal occurs that is being trapped by a signal handler, that handler is invoked. When it is finished, execution continues at the point at which the signal occurred. This arrangement could cause problems if the signal handler invokes a library function that was being executed at the time of the signal. Since library functions are not guaranteed to be re-entrant, they should not be called from a signal handler that returns. (See .2.3.) A specific exception to this rule has been granted for calls to signal from within the signal handler; otherwise, the handler could not reliably reset the signal.

The specification that some signals may be effectively set to SIG_IGN instead of SIG_DFL at program startup allows programs under UNIX systems to inherit this effective setting from parent processes.

For performance reasons, UNIX does not reset SIGILL to default handling when the handler is called (usually to emulate missing instructions). This treatment is sanctioned by specifying that whether reset occurs for SIGILL is implementation-definedimplementation-defined behavior.

4 7 2


Pete Jinks
Fri Jan 19 12:31:56 GMT 1996