3 /* signal( int sig, void (*func)( int ) )
5 This file is part of the Public Domain C Library (PDCLib).
6 Permission is granted to use, modify, and / or redistribute at will.
16 void (*_PDCLIB_sigabrt)( int ) = SIG_DFL;
17 void (*_PDCLIB_sigfpe)( int ) = SIG_DFL;
18 void (*_PDCLIB_sigill)( int ) = SIG_DFL;
19 void (*_PDCLIB_sigint)( int ) = SIG_DFL;
20 void (*_PDCLIB_sigsegv)( int ) = SIG_DFL;
21 void (*_PDCLIB_sigterm)( int ) = SIG_DFL;
23 void (*signal( int sig, void (*func)( int ) ) )( int )
25 void (*oldhandler)( int );
26 if ( sig <= 0 || func == SIG_ERR )
33 oldhandler = _PDCLIB_sigabrt;
34 _PDCLIB_sigabrt = func;
37 oldhandler = _PDCLIB_sigfpe;
38 _PDCLIB_sigfpe = func;
41 oldhandler = _PDCLIB_sigill;
42 _PDCLIB_sigill = func;
45 oldhandler = _PDCLIB_sigint;
46 _PDCLIB_sigint = func;
49 oldhandler = _PDCLIB_sigsegv;
50 _PDCLIB_sigsegv = func;
53 oldhandler = _PDCLIB_sigterm;
54 _PDCLIB_sigterm = func;
66 #include <_PDCLIB_test.h>
70 /* Testing covered by raise.c */