2 #include "include/internal/wine/msvcrt.h"
4 static sig_element signal_list
[] =
6 { SIGINT
, "CTRL+C",SIG_DFL
},
7 { SIGILL
, "Illegal instruction",SIG_DFL
},
8 { SIGFPE
, "Floating-point exception",SIG_DFL
},
9 { SIGSEGV
, "Illegal storage access",SIG_DFL
},
10 { SIGTERM
, "Termination request",SIG_DFL
},
11 { SIGBREAK
, "CTRL+BREAK",SIG_DFL
},
12 { SIGABRT
, "Abnormal termination",SIG_DFL
}
20 //void ( *signal( int sig, void (__cdecl *func) ( int sig [, int subcode ] )) ) ( int sig );
23 __p_sig_fn_t
signal(int sig
, __p_sig_fn_t func
)
44 // check with IsBadCodePtr
45 if ( (uintptr_t)func
< 4096 && func
!= SIG_DFL
&& func
!= SIG_IGN
)
51 for(i
=0; i
< sizeof(signal_list
)/sizeof(signal_list
[0]); i
++)
53 if ( signal_list
[i
].signal
== sig
)
55 temp
= signal_list
[i
].handler
;
56 signal_list
[i
].handler
= func
;
61 /* should be impossible to get here */
73 __p_sig_fn_t temp
= 0;
88 //FIXME: set last err?
98 for(i
=0;i
<sizeof(signal_list
)/sizeof(signal_list
[0]);i
++)
100 if ( signal_list
[i
].signal
== sig
)
102 temp
= signal_list
[i
].handler
;
107 if(temp
== SIG_IGN
)// || (sig == SIGQUIT && temp == (_p_sig_fn_t)SIG_DFL))
108 return 0; /* Ignore it */
111 _default_handler(sig
); /* this does not return */
120 void _default_handler(int sig
)