The memcheck/tests/sigprocmask test is designed to test that we handle
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 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am
index 5f77013..a60293e 100644
--- a/memcheck/tests/Makefile.am
+++ b/memcheck/tests/Makefile.am
@@ -73,7 +73,7 @@
 	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 \
diff --git a/memcheck/tests/sigprocmask.c b/memcheck/tests/sigprocmask.c
index 97c4c0a..e1f4359 100644
--- a/memcheck/tests/sigprocmask.c
+++ b/memcheck/tests/sigprocmask.c
@@ -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 @@
    // 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 @@
    }
    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 @@
    }
    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
index 0000000..ac622d5
--- /dev/null
+++ b/memcheck/tests/sigprocmask.stderr.exp2
@@ -0,0 +1 @@
+__NR_sigprocmask not supported on this platform