|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T s
Length: 1578 (0x62a) Types: TextFile Names: »siginit.c«
└─⟦2d1937cfd⟧ Bits:30007241 EUUGD22: P.P 5.0 └─⟦dc59850a2⟧ »EurOpenD22/pp5.0/pp-5.tar.Z« └─⟦e5a54fb17⟧ └─⟦this⟧ »pp-5.0/Lib/util/siginit.c«
/* signals: catch some disatorous signals */ # ifndef lint static char Rcsid[] = "@(#)$Header: /cs/research/pp/hubris/pp-beta/Lib/util/RCS/siginit.c,v 5.0 90/09/20 16:17:57 pp Exp Locker: pp $"; # endif /* * $Header: /cs/research/pp/hubris/pp-beta/Lib/util/RCS/siginit.c,v 5.0 90/09/20 16:17:57 pp Exp Locker: pp $ * * $Log: siginit.c,v $ * Revision 5.0 90/09/20 16:17:57 pp * rcsforce : 5.0 public release * */ #include "util.h" #include <signal.h> #ifndef sigmask #define sigmask(m) (1<< ((m) - 1)) #endif static int onsig (); void siginit () { int mask; mask = sigblock (sigmask(SIGILL) | sigmask(SIGFPE) | sigmask(SIGBUS) | sigmask(SIGSEGV) | sigmask(SIGSYS) | sigmask(SIGPIPE) ); (void) signal (SIGILL, onsig); (void) signal (SIGFPE, onsig); (void) signal (SIGBUS, onsig); (void) signal (SIGSEGV, onsig); (void) signal (SIGSYS, onsig); (void) signal (SIGPIPE, onsig); (void) sigsetmask (mask); } /* ARGSUSED */ static int onsig (sig, code, context) int sig, code; struct sigcontext *context; { #ifndef SYSV extern char *sys_siglist[]; #endif (void) signal (sig, SIG_DFL); /* to stop recursion */ (void) signal (SIGIOT, SIG_DFL); /* for abort */ (void) signal (SIGILL, SIG_DFL); /* for abort too */ #ifdef SIGABRT (void) signal (SIGABRT, SIG_DFL); #endif sigsetmask (sigblock (0) & ~ (sigmask(SIGILL) | sigmask(SIGIOT))); #ifdef SYSV PP_OPER (NULLCP, ("Process dying on signal %d", sig)); #else PP_OPER (NULLCP, ("Process dying on signal %d (%s)", sig, sys_siglist[sig])); #endif return abort (); }