Checking the return value
The data type that signal() returns is:
pointer to function with int argument returning void
So, the variable used to hold the result of a call to signal should be declared as follows:
void (*signal_result)(int);
It is possible for a child process to accept signals that are being ignored by the parent, which more than likely is undesirable
Thus, the normal method of installing a new signal handler is:
oldhandler = sigset( SIGHUP, SIG_IGN );
if( oldhandler != SIG_IGN )
sigset( SIGHUP, newhandler );