Syntax | #include <signal.h> void ( *bsd_signal(int sig, void ( *func)(int))) (int); | |
Description | The The function call void (*bsd_signal(int sig, void (*func)(int)))(int) { struct sigaction act, oact; act.sa_handler = func; act.sa_flags = SA_RESTART; sigemptyset(&act.sa_mask); sigaddset(&act.sa_mask, sig); if (sigaction(sig, &act, &oact) == -1) return(SIG_ERR); return(oact.sa_handler); } The event handling function should be declared as follows:
where sig stands for the signal number. The behavior is not defined if func is a function which | |
Return val. | The preceding action for sig | |
if successful. | ||
| if an error occurs. | |
Errors Notes | See This function is a direct substitute for the BSD function | |
See also |
|