Bug 497723 - forgot to restore callgrind output cleanup
[valgrind.git] / none / tests / sigprocmask.c
blob4cb77c594cfeaff2a08b0c306fb53caead52ec5c
1 #define _GNU_SOURCE
3 #include <stdio.h>
4 #include <stdlib.h>
5 #include <signal.h>
7 #include <errno.h>
9 int main() {
11 sigset_t oldset;
13 const int TRASH = 123;
15 // TRASH variable, that represents HOW parameter, should be ignored in this case
16 // Taken from: http://man7.org/linux/man-pages/man2/sigprocmask.2.html :
17 // If set is NULL, then the signal mask is unchanged (i.e., HOW is
18 // ignored), but the current value of the signal mask is nevertheless
19 // returned in oldset (if it is not NULL).
20 if (sigprocmask(TRASH, NULL, &oldset) == 0) {
21 exit(EXIT_FAILURE);
22 } else {
23 exit(EXIT_SUCCESS);