1 /* signal( int sig, void (*func)( 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.
14 void (*_PDCLIB_sigabrt)( int ) = SIG_DFL;
15 void (*_PDCLIB_sigfpe)( int ) = SIG_DFL;
16 void (*_PDCLIB_sigill)( int ) = SIG_DFL;
17 void (*_PDCLIB_sigint)( int ) = SIG_DFL;
18 void (*_PDCLIB_sigsegv)( int ) = SIG_DFL;
19 void (*_PDCLIB_sigterm)( int ) = SIG_DFL;
21 void (*signal( int sig, void (*func)( int ) ) )( int )
23 void (*oldhandler)( int );
24 if ( sig <= 0 || func == SIG_ERR )
31 oldhandler = _PDCLIB_sigabrt;
32 _PDCLIB_sigabrt = func;
35 oldhandler = _PDCLIB_sigfpe;
36 _PDCLIB_sigfpe = func;
39 oldhandler = _PDCLIB_sigill;
40 _PDCLIB_sigill = func;
43 oldhandler = _PDCLIB_sigint;
44 _PDCLIB_sigint = func;
47 oldhandler = _PDCLIB_sigsegv;
48 _PDCLIB_sigsegv = func;
51 oldhandler = _PDCLIB_sigterm;
52 _PDCLIB_sigterm = func;
55 /* The standard calls for an unspecified "positive value". You
56 will probably want to define a specific value for this.
67 #include <_PDCLIB_test.h>
71 /* Testing covered by raise.c */