blob: 148029c0cee6fbd7a80c155516362e7eb295dd26 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#include <signal.h>
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;
}
/*
XOPEN(400,700)
*/
|