1 /* signal( int, void (*)( int ) )
3 This file is part of the Public Domain C Library (PDCLib).
4 Permission is granted to use, modify, and / or redistribute at will.
13 void (*_PDCLIB_sigabrt)( int ) = SIG_DFL;
14 void (*_PDCLIB_sigfpe)( int ) = SIG_DFL;
15 void (*_PDCLIB_sigill)( int ) = SIG_DFL;
16 void (*_PDCLIB_sigint)( int ) = SIG_DFL;
17 void (*_PDCLIB_sigsegv)( int ) = SIG_DFL;
18 void (*_PDCLIB_sigterm)( int ) = SIG_DFL;
20 void (*signal( int sig, void (*func)( int ) ) )( int )
22 void (*oldhandler)( int );
23 if ( sig <= 0 || func == SIG_ERR )
30 oldhandler = _PDCLIB_sigabrt;
31 _PDCLIB_sigabrt = func;
34 oldhandler = _PDCLIB_sigfpe;
35 _PDCLIB_sigfpe = func;
38 oldhandler = _PDCLIB_sigill;
39 _PDCLIB_sigill = func;
42 oldhandler = _PDCLIB_sigint;
43 _PDCLIB_sigint = func;
46 oldhandler = _PDCLIB_sigsegv;
47 _PDCLIB_sigsegv = func;
50 oldhandler = _PDCLIB_sigterm;
51 _PDCLIB_sigterm = func;
54 /* The standard calls for an unspecified "positive value". You
55 will probably want to define a specific value for this.
66 #include <_PDCLIB_test.h>
70 /* Testing covered by raise.c */