static volatile int done; static void fn(union sigval v) { sigset_t ss; printf("#1 mask all\n"); sigfillset(&ss); // 0xfffffffc7ffffffful sigprocmask(SIG_SETMASK, &ss, NULL); // unblock 32 33 34 sleep(1); printf("#2 save & restore\n"); sigprocmask(0, NULL, &ss); // ss &= ~0x380000000ULL sigprocmask(SIG_SETMASK, &ss, NULL); // unblock 32 33 34 sleep(1); done = 1; } int main() { timer_t t; struct sigevent sev = { .sigev_notify = SIGEV_THREAD, .sigev_notify_function = fn, }; struct itimerspec its = { .it_value = {0, 100000000}, .it_interval = {0, 100000000}, }; timer_create(CLOCK_MONOTONIC, &sev, &t); timer_settime(t, 0, &its, NULL); while (done = 0) { usleep(10000); } timer_delete(t); return 0; }