]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
The memcheck/tests/sigprocmask test is designed to test that we handle
authorTom Hughes <tom@compton.nu>
Wed, 2 Nov 2005 15:46:07 +0000 (15:46 +0000)
committerTom Hughes <tom@compton.nu>
Wed, 2 Nov 2005 15:46:07 +0000 (15:46 +0000)
the old style sigprocmask system call correctly without corrupting
memory when we copy out the new (larger) signal mask into the user
provided old (smaller) signal mask.

It therefore makes no sense to run it on amd64 or any other platform
which only has the newer rt_sigprocmask system call, and indeed it
wasn't working because we weren't passing the extra argument which
that call expects.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@4990

memcheck/tests/Makefile.am
memcheck/tests/sigprocmask.c
memcheck/tests/sigprocmask.stderr.exp2 [new file with mode: 0644]

index 5f7701355bf3e5c9ec50a6d3b50195afd3217cff..a60293e3a5d941e1a52de76cc0d77a67bd75ff26 100644 (file)
@@ -73,7 +73,7 @@ EXTRA_DIST = $(noinst_SCRIPTS) \
        sigaltstack.stderr.exp sigaltstack.vgtest \
        sigkill.stderr.exp sigkill.stderr.exp2 sigkill.vgtest \
        signal2.stderr.exp signal2.stdout.exp signal2.vgtest \
-       sigprocmask.stderr.exp sigprocmask.vgtest \
+       sigprocmask.stderr.exp sigprocmask.stderr.exp2 sigprocmask.vgtest \
        stack_changes.stderr.exp stack_changes.stdout.exp stack_changes.vgtest \
        strchr.stderr.exp strchr.stderr.exp2 strchr.vgtest \
        str_tester.stderr.exp str_tester.vgtest \
index 97c4c0ae93032bf317576f402534dfd22197c36b..e1f4359bc1a4bc5cc70a394bedd2670c71c9a1d9 100644 (file)
@@ -9,12 +9,9 @@
 
 int main(void)
 {
-   int x[6], *s, *os, i, sysno;
+   int x[6], *s, *os, i;
 
-   sysno = __NR_rt_sigprocmask;
 #ifdef __NR_sigprocmask
-   sysno = __NR_sigprocmask;
-#endif
 
    x[0] = 0x11111111;
    x[1] = 0x89abcdef;
@@ -30,7 +27,7 @@ int main(void)
    // blocked as perl has been known to leave some signals blocked
    // when starting child processes which can cause failures in
    // this test unless we reset things here.
-   syscall(sysno, SIG_SETMASK, os, NULL);
+   syscall(__NR_sigprocmask, SIG_SETMASK, os, NULL);
 
    fprintf(stderr, "before\n");
    for (i = 0; i < 6; i++) {
@@ -38,7 +35,7 @@ int main(void)
    }
    fprintf(stderr, "\n");
 
-   syscall(sysno, SIG_BLOCK, s, os);
+   syscall(__NR_sigprocmask, SIG_BLOCK, s, os);
 
    fprintf(stderr, "after1\n");
    for (i = 0; i < 6; i++) {
@@ -46,13 +43,19 @@ int main(void)
    }
    fprintf(stderr, "\n");
    
-   syscall(sysno, SIG_BLOCK, s, os);
+   syscall(__NR_sigprocmask, SIG_BLOCK, s, os);
 
    fprintf(stderr, "after2\n");
    for (i = 0; i < 6; i++) {
       fprintf(stderr, "%x ", x[i]);
    }
    fprintf(stderr, "\n");
-   
+
+#else
+
+   fprintf(stderr, "__NR_sigprocmask not supported on this platform\n");
+
+#endif
+
    return(0);
 }
diff --git a/memcheck/tests/sigprocmask.stderr.exp2 b/memcheck/tests/sigprocmask.stderr.exp2
new file mode 100644 (file)
index 0000000..ac622d5
--- /dev/null
@@ -0,0 +1 @@
+__NR_sigprocmask not supported on this platform