From 2467698569ea5532034026ce9a4d6252674872f5 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Wed, 2 Nov 2005 15:46:07 +0000 Subject: [PATCH] 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 --- memcheck/tests/Makefile.am | 2 +- memcheck/tests/sigprocmask.c | 19 +++++++++++-------- memcheck/tests/sigprocmask.stderr.exp2 | 1 + 3 files changed, 13 insertions(+), 9 deletions(-) create mode 100644 memcheck/tests/sigprocmask.stderr.exp2 diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 5f7701355b..a60293e3a5 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -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 \ diff --git a/memcheck/tests/sigprocmask.c b/memcheck/tests/sigprocmask.c index 97c4c0ae93..e1f4359bc1 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 @@ 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 index 0000000000..ac622d5095 --- /dev/null +++ b/memcheck/tests/sigprocmask.stderr.exp2 @@ -0,0 +1 @@ +__NR_sigprocmask not supported on this platform -- 2.47.3