/* HANDLE SIGNALS -- must be used on top level as function definition */ #define HANDLE(sig, flags, handlr) \ static void __sighandler_##sig(int, siginfo_t *, void *); \ static void __sigwrapper_##sig(int s, siginfo_t *i, void *c) { \ int old_errno = errno; \ __sighandler_##sig(s, i, c); \ errno = old_errno; \ } \ static void __attribute__((constructor)) __siginit_##sig() { \ struct sigaction act = { .sa_flags = flags }; \ if (handlr) act.sa_handler = handlr; \ else act.sa_sigaction = __sigwrapper_##sig; \ MUSTP(QF, sigemptyset, &act.sa_mask); \ MUSTP(QF, sigaction, sig, &act, NULL); \ } \ static void __sighandler_##sig(int __attribute__((unused)) signal, \ siginfo_t __attribute__((unused)) * info, \ void __attribute__((unused)) * ctx)