DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T s

⟦7f2627a6c⟧ TextFile

    Length: 1578 (0x62a)
    Types: TextFile
    Names: »siginit.c«

Derivation

└─⟦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« 

TextFile

/* 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 ();
}