Added jack plugs into netyack
[transsip-mirror.git] / src / signals.h
blobe67b8bff8dd3dfc58d2918850fb1a7c94636d6f5
1 /*
2 * netyack
3 * By Daniel Borkmann <daniel@netyack.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
5 * Subject to the GPL, version 2.
6 */
8 #ifndef SIGNALS_H
9 #define SIGNALS_H
11 #include <signal.h>
12 #include <assert.h>
14 static inline void register_signal(int signal, void (*handler)(int))
16 sigset_t block_mask;
17 struct sigaction saction;
19 assert(handler);
21 sigfillset(&block_mask);
22 saction.sa_handler = handler;
23 saction.sa_mask = block_mask;
24 saction.sa_flags = SA_RESTART;
26 sigaction(signal, &saction, NULL);
29 #endif /* SIGNALS_H */