13 |
//EOP |
//EOP |
14 |
|
|
15 |
*/ |
*/ |
16 |
|
#ifdef HAVE_SIGREG |
17 |
/* Here, we get the definition of the FC_NAMEMANGLE() macro. */ |
/* Here, we get the definition of the FC_NAMEMANGLE() macro. */ |
18 |
#include "FC_NAMEMANGLE.h" |
#include "FC_NAMEMANGLE.h" |
19 |
|
|
25 |
#include <signal.h> |
#include <signal.h> |
26 |
#include <errno.h> |
#include <errno.h> |
27 |
#include <ucontext.h> |
#include <ucontext.h> |
|
#endif |
|
28 |
|
|
29 |
int * ip; |
int * sigreg_ip; |
30 |
|
|
|
#ifdef HAVE_SIGREG |
|
31 |
static void killhandler( |
static void killhandler( |
32 |
unsigned int sn, siginfo_t si, struct ucontext *sc ) |
unsigned int sn, siginfo_t si, struct ucontext *sc ) |
33 |
{ |
{ |
34 |
*ip = *ip + 1; |
*sigreg_ip = *sigreg_ip + 1; |
35 |
return; |
return; |
36 |
} |
} |
37 |
#endif |
#endif |
41 |
{ |
{ |
42 |
#ifdef HAVE_SIGREG |
#ifdef HAVE_SIGREG |
43 |
struct sigaction s; |
struct sigaction s; |
44 |
ip = aip; |
sigreg_ip = aip; |
45 |
s.sa_flags = SA_SIGINFO; |
s.sa_flags = SA_SIGINFO; |
46 |
s.sa_sigaction = (void *)killhandler; |
s.sa_sigaction = (void *)killhandler; |
47 |
if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) { |
if(sigaction (SIGTERM,&s,(struct sigaction *)NULL)) { |
51 |
#endif |
#endif |
52 |
return; |
return; |
53 |
} |
} |
54 |
|
#endif |
55 |
|
|