sigdfl(3)

NAME
sigdfl - invoke the default action for a signal

SYNTAX
#include <sigdfl.h> int sigdfl(sig); int sigdfl_ttou();
int sigdfl_tstp();
int sigdfl_ttin();
int sigdfl_stop(); int sigdfl_abrt(); int sig;

DESCRIPTION
sigdfl(sig) has exactly the same effect as what happens if the process isn't blocking sig, has SIG_DFL as the handler for sig, and then receives sig. In the case of stop signals (TSTP, TTIN, TTOU, STOP), sigdfl will absorb one or more CONT signals before returning. sigdfl is safe against multithreading. sigdfl has several interesting uses inside signal handlers. For instance, the handler for SEGV can clean up the tty and then call sigdfl(SIGSEGV). Unlike a simple abort(), this doesn't hide the reason for the core dump from the user. Similar comments apply to the stop signals. Note that processes handling a stop signal should take steps to ensure that they are back in the foreground after sigdfl returns. sigdfl returns 0 normally, -1 with errno set in case of various impossible errors. sigdfl_tstp() is the same as sigdfl(SIGTSTP). On systems not supporting SIGTSTP, sigdfl_tstp returns -1 with errno ENOTTY. Similar comments apply to sigdfl_stop(), sigdfl_ttin(), and sigdfl_ttou(). sigdfl_abrt() is a professional version of abort(); it will dump core with the ABRT signal, even if an ABRT handler is in place. SIG_DFL could, in principle, be implemented as sigdfl.

VERSION
sigdfl 1.0, July 18, 1991.

AUTHOR
Placed into the public domain by Daniel J. Bernstein.

SEE ALSO
signal(3), abort(3)