]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Oops, add missing file.
authorJeremy Fitzhardinge <jeremy@valgrind.org>
Fri, 16 Jan 2004 05:37:46 +0000 (05:37 +0000)
committerJeremy Fitzhardinge <jeremy@valgrind.org>
Fri, 16 Jan 2004 05:37:46 +0000 (05:37 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2200

none/tests/exec-sigmask.c [new file with mode: 0644]

diff --git a/none/tests/exec-sigmask.c b/none/tests/exec-sigmask.c
new file mode 100644 (file)
index 0000000..db2e7b3
--- /dev/null
@@ -0,0 +1,37 @@
+#include <unistd.h>
+#include <signal.h>
+#include <errno.h>
+#include <string.h>
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+       if (argc == 1) {
+               sigset_t all;
+
+
+               sigfillset(&all);
+               sigprocmask(SIG_SETMASK, &all, NULL);
+
+               execl(argv[0], argv[0], "test", NULL);
+
+               fprintf(stderr, "FAILED: execl failed with %s\n",
+                       strerror(errno));
+               return 1;
+       } else {
+               sigset_t mask;
+               int i;
+
+               sigprocmask(SIG_SETMASK, NULL, &mask);
+
+               for(i = 1; i < NSIG; i++) {
+                       if (i == SIGKILL || i == SIGSTOP)
+                               continue;
+
+                       if (!sigismember(&mask, i))
+                               printf("signal %d missing from mask\n", i);
+               }
+       }
+
+       return 0;
+}