]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Enable sigsuspend on x86-linux and ppc32-linux.
authorTom Hughes <tom@compton.nu>
Mon, 3 Apr 2006 16:38:33 +0000 (16:38 +0000)
committerTom Hughes <tom@compton.nu>
Mon, 3 Apr 2006 16:38:33 +0000 (16:38 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@5819

coregrind/m_syswrap/priv_syswrap-generic.h
coregrind/m_syswrap/syswrap-generic.c
coregrind/m_syswrap/syswrap-ppc32-linux.c
coregrind/m_syswrap/syswrap-x86-linux.c

index 5c059dc1ffe6694e8353cc7cbf8b5435c522014f..9507cb6143d9825fd10aba8b82befebc562337b0 100644 (file)
@@ -170,7 +170,6 @@ DECL_TEMPLATE(generic, sys_newfstat);              // * P (SVr4,BSD4.3)
 
 // For the remainder, not really sure yet
 DECL_TEMPLATE(generic, sys_ptrace);                // (x86?) (almost-P)
-DECL_TEMPLATE(generic, sys_sigsuspend);            // POSIX, but L (proto varies across archs)
 DECL_TEMPLATE(generic, sys_setrlimit);             // SVr4, 4.3BSD
 DECL_TEMPLATE(generic, sys_ioctl);                 // x86? (various)
 DECL_TEMPLATE(generic, sys_old_getrlimit);         // SVr4, 4.3BSD L?
index 5422e8f99af2971fdc972af8a656a9bfeed98d23..8b9c30650a0dbb8cf61715ed60bfd698aeb54f70 100644 (file)
@@ -5290,24 +5290,6 @@ PRE(sys_pause)
    PRE_REG_READ0(long, "pause");
 }
 
-//zz // XXX: x86-specific
-//zz PRE(sys_sigsuspend, SfMayBlock)
-//zz {
-//zz    /* The C library interface to sigsuspend just takes a pointer to
-//zz       a signal mask but this system call has three arguments - the first
-//zz       two don't appear to be used by the kernel and are always passed as
-//zz       zero by glibc and the third is the first word of the signal mask
-//zz       so only 32 signals are supported.
-//zz      
-//zz       In fact glibc normally uses rt_sigsuspend if it is available as
-//zz       that takes a pointer to the signal mask so supports more signals.
-//zz     */
-//zz    PRINT("sys_sigsuspend ( %d, %d, %d )", ARG1,ARG2,ARG3 );
-//zz    PRE_REG_READ3(int, "sigsuspend",
-//zz                  int, history0, int, history1,
-//zz                  vki_old_sigset_t, mask);
-//zz }
-
 // XXX: x86-specific
 PRE(sys_sigaltstack)
 {
index f02eb18658f62112fb79973b4dec103751e227ad..b32031d5300d6843774505a1bf4110326038acb1 100644 (file)
@@ -392,6 +392,7 @@ DECL_TEMPLATE(ppc32_linux, sys_clone);
 DECL_TEMPLATE(ppc32_linux, sys_sigreturn);
 DECL_TEMPLATE(ppc32_linux, sys_rt_sigreturn);
 DECL_TEMPLATE(ppc32_linux, sys_sigaction);
+DECL_TEMPLATE(ppc32_linux, sys_sigsuspend);
 
 PRE(sys_socketcall)
 {
@@ -1424,6 +1425,20 @@ POST(sys_sigaction)
       POST_MEM_WRITE( ARG3, sizeof(struct vki_old_sigaction));
 }
 
+PRE(sys_sigsuspend)
+{
+   /* The C library interface to sigsuspend just takes a pointer to
+      a signal mask but this system call only takes the first word of
+      the signal mask as an argument so only 32 signals are supported.
+     
+      In fact glibc normally uses rt_sigsuspend if it is available as
+      that takes a pointer to the signal mask so supports more signals.
+    */
+   *flags |= SfMayBlock;
+   PRINT("sys_sigsuspend ( %d )", ARG1 );
+   PRE_REG_READ1(int, "sigsuspend", vki_old_sigset_t, mask);
+}
+
 
 #undef PRE
 #undef POST
@@ -1461,7 +1476,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
    GENX_(__NR_execve,            sys_execve),            // 11
    GENX_(__NR_chdir,             sys_chdir),             // 12
    GENXY(__NR_time,              sys_time),              // 13
-//..    GENX_(__NR_mknod,             sys_mknod),             // 14
+   GENX_(__NR_mknod,             sys_mknod),             // 14
 //.. 
    GENX_(__NR_chmod,             sys_chmod),             // 15
 //..    LINX_(__NR_lchown,            sys_lchown16),          // 16 ## P
@@ -1531,7 +1546,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 //.. 
 //..    LINX_(__NR_setreuid,          sys_setreuid16),        // 70
 //..    LINX_(__NR_setregid,          sys_setregid16),        // 71
-//..    GENX_(__NR_sigsuspend,        sys_sigsuspend),        // 72
+   PLAX_(__NR_sigsuspend,        sys_sigsuspend),        // 72
 //..    LINXY(__NR_sigpending,        sys_sigpending),        // 73
 //..    //   (__NR_sethostname,       sys_sethostname),       // 74 */*
 //.. 
index 949f08277331092b6f08809d2af4101a53a01e3d..cf905a2d6cf33d8faf562da55f281e1909202fef 100644 (file)
@@ -772,6 +772,7 @@ DECL_TEMPLATE(x86_linux, sys_set_thread_area);
 DECL_TEMPLATE(x86_linux, sys_get_thread_area);
 DECL_TEMPLATE(x86_linux, sys_ptrace);
 DECL_TEMPLATE(x86_linux, sys_sigaction);
+DECL_TEMPLATE(x86_linux, sys_sigsuspend);
 DECL_TEMPLATE(x86_linux, old_select);
 DECL_TEMPLATE(x86_linux, sys_vm86old);
 DECL_TEMPLATE(x86_linux, sys_vm86);
@@ -1694,6 +1695,24 @@ POST(sys_sigaction)
       POST_MEM_WRITE( ARG3, sizeof(struct vki_old_sigaction));
 }
 
+PRE(sys_sigsuspend)
+{
+   /* The C library interface to sigsuspend just takes a pointer to
+      a signal mask but this system call has three arguments - the first
+      two don't appear to be used by the kernel and are always passed as
+      zero by glibc and the third is the first word of the signal mask
+      so only 32 signals are supported.
+     
+      In fact glibc normally uses rt_sigsuspend if it is available as
+      that takes a pointer to the signal mask so supports more signals.
+    */
+   *flags |= SfMayBlock;
+   PRINT("sys_sigsuspend ( %d, %d, %d )", ARG1,ARG2,ARG3 );
+   PRE_REG_READ3(int, "sigsuspend",
+                 int, history0, int, history1,
+                 vki_old_sigset_t, mask);
+}
+
 PRE(sys_vm86old)
 {
    PRINT("sys_vm86old ( %p )", ARG1);
@@ -1863,7 +1882,7 @@ const SyscallTableEntry ML_(syscall_table)[] = {
 //zz 
    LINX_(__NR_setreuid,          sys_setreuid16),     // 70
    LINX_(__NR_setregid,          sys_setregid16),     // 71
-//zz    GENX_(__NR_sigsuspend,        sys_sigsuspend),     // 72
+   PLAX_(__NR_sigsuspend,        sys_sigsuspend),     // 72
    LINXY(__NR_sigpending,        sys_sigpending),     // 73
 //zz    //   (__NR_sethostname,       sys_sethostname),    // 74 */*
 //zz