Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <signal.h>
- static void nop(int unused) { }
- int
- main(void) {
- struct sigaction sa, osa;
- sigset_t mask;
- sigemptyset(&sa.sa_mask);
- sigemptyset(&osa.sa_mask);
- sa.sa_flags = 0;
- sa.sa_handler = nop;
- sigprocmask(0, NULL, &mask);
- printf("%dn", sigismember(&mask, SIGALRM));
- sigaction(SIGALRM, &sa, &osa);
- printf("%dn", sigismember(&osa.sa_mask, SIGALRM));
- printf("%dn", sigismember(&sa.sa_mask, SIGALRM));
- return 0;
- }
- 0
- 1
- 0
- 0
- 0
- 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement