6 void register_signal(int signal
, void (*handler
)(int))
9 struct sigaction saction
;
11 sigfillset(&block_mask
);
13 saction
.sa_handler
= handler
;
14 saction
.sa_mask
= block_mask
;
15 saction
.sa_flags
= SA_RESTART
;
17 sigaction(signal
, &saction
, NULL
);
20 void register_signal_f(int signal
, void (*handler
)(int), int flags
)
23 struct sigaction saction
;
25 sigfillset(&block_mask
);
27 saction
.sa_handler
= handler
;
28 saction
.sa_mask
= block_mask
;
29 saction
.sa_flags
= flags
;
31 sigaction(signal
, &saction
, NULL
);