Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/compat/linux32 Fix rt_sigtimedwait():



details:   https://anonhg.NetBSD.org/src/rev/0fef8cb87b3a
branches:  trunk
changeset: 779213:0fef8cb87b3a
user:      christos <christos%NetBSD.org@localhost>
date:      Thu May 10 19:40:46 2012 +0000

description:
Fix rt_sigtimedwait():
It is wishful thinking that:
    1. declaring a 32 bit syscall with 64 bit pointers
    2. passing a struct with 32 bit pointers to a 64 bit function
is going to work.

diffstat:

 sys/compat/linux32/arch/amd64/syscalls.master |   8 ++++----
 sys/compat/linux32/common/linux32_signal.c    |  11 ++++++++---
 2 files changed, 12 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r 375b603966b9 -r 0fef8cb87b3a sys/compat/linux32/arch/amd64/syscalls.master
--- a/sys/compat/linux32/arch/amd64/syscalls.master     Thu May 10 19:38:23 2012 +0000
+++ b/sys/compat/linux32/arch/amd64/syscalls.master     Thu May 10 19:40:46 2012 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.60 2011/11/18 04:08:56 christos Exp $
+       $NetBSD: syscalls.master,v 1.61 2012/05/10 19:40:46 christos Exp $
 
 ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
 ; (See syscalls.conf to see what it is processed into.)
@@ -318,9 +318,9 @@
 176    STD     { int|linux32_sys||rt_sigpending(linux32_sigsetp_t set, \
                    netbsd32_size_t sigsetsize); }
 177    STD     { int|linux32_sys||rt_sigtimedwait( \
-                   const linux32_sigset_t *set, \
-                   linux32_siginfo_t *info, \
-                   const struct linux_timespec32 *timeout); }
+                   const linux32_sigsetp_t set, \
+                   linux32_siginfop_t info, \
+                   const linux32_timespecp_t timeout); }
 178    STD     { int|linux32_sys||rt_queueinfo(int pid, int sig, \
                    linux32_siginfop_t uinfo); }
 179    STD     { int|linux32_sys||rt_sigsuspend(linux32_sigsetp_t unewset, \
diff -r 375b603966b9 -r 0fef8cb87b3a sys/compat/linux32/common/linux32_signal.c
--- a/sys/compat/linux32/common/linux32_signal.c        Thu May 10 19:38:23 2012 +0000
+++ b/sys/compat/linux32/common/linux32_signal.c        Thu May 10 19:40:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_signal.c,v 1.15 2011/11/18 15:46:29 christos Exp $ */
+/*     $NetBSD: linux32_signal.c,v 1.16 2012/05/10 19:40:46 christos Exp $ */
 
 /*-
  * Copyright (c) 2006 Emmanuel Dreyfus, all rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.15 2011/11/18 15:46:29 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_signal.c,v 1.16 2012/05/10 19:40:46 christos Exp $");
 
 #include <sys/param.h>
 #include <sys/ucred.h>
@@ -484,8 +484,13 @@
                syscallarg(linux32_siginfo_t *) info);
                syscallarg(const struct linux32_timespec *) timeout;
        } */
+       struct sys_____sigtimedwait50_args ap;
 
-       return sigtimedwait1(l, (const struct sys_____sigtimedwait50_args *)uap,
+       SCARG(&ap, set) = SCARG_P32(uap, set);
+       SCARG(&ap, info) = SCARG_P32(uap, info);
+       SCARG(&ap, timeout) = SCARG_P32(uap, timeout);
+
+       return sigtimedwait1(l, &ap,
            retval, fetchss, storeinfo, fetchts, fakestorets);
 }
 



Home | Main Index | Thread Index | Old Index