Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/linux32 Add ppoll(2) for compat linux32.



details:   https://anonhg.NetBSD.org/src/rev/c5c76046d1dd
branches:  trunk
changeset: 804065:c5c76046d1dd
user:      njoly <njoly%NetBSD.org@localhost>
date:      Sat Nov 22 13:12:22 2014 +0000

description:
Add ppoll(2) for compat linux32.

diffstat:

 sys/compat/linux32/arch/amd64/syscalls.master |   5 +-
 sys/compat/linux32/common/linux32_misc.c      |  41 +++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 4 deletions(-)

diffs (85 lines):

diff -r 9172760f724d -r c5c76046d1dd sys/compat/linux32/arch/amd64/syscalls.master
--- a/sys/compat/linux32/arch/amd64/syscalls.master     Sat Nov 22 11:59:33 2014 +0000
+++ b/sys/compat/linux32/arch/amd64/syscalls.master     Sat Nov 22 13:12:22 2014 +0000
@@ -1,4 +1,4 @@
-       $NetBSD: syscalls.master,v 1.67 2014/05/29 10:47:00 njoly Exp $
+       $NetBSD: syscalls.master,v 1.68 2014/11/22 13:12:22 njoly Exp $
 
 ; NetBSD i386 COMPAT_LINUX32 system call name/number "master" file.
 ; (See syscalls.conf to see what it is processed into.)
@@ -524,7 +524,8 @@
 307    STD     { int|linux32_sys||faccessat(int fd, netbsd32_charp path, \
                    int amode); }
 308    UNIMPL  pselect6
-309    UNIMPL  ppoll
+309    STD     { int|linux32_sys||ppoll(netbsd32_pollfdp_t fds, u_int nfds, \
+                   linux32_timespecp_t timeout, linux32_sigsetp_t sigset); }
 310    UNIMPL  unshare
 311    STD     { int|linux32_sys||set_robust_list( \
                    linux32_robust_list_headp_t head, linux32_size_t len); }
diff -r 9172760f724d -r c5c76046d1dd sys/compat/linux32/common/linux32_misc.c
--- a/sys/compat/linux32/common/linux32_misc.c  Sat Nov 22 11:59:33 2014 +0000
+++ b/sys/compat/linux32/common/linux32_misc.c  Sat Nov 22 13:12:22 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: linux32_misc.c,v 1.24 2014/11/09 17:48:08 maxv Exp $   */
+/*     $NetBSD: linux32_misc.c,v 1.25 2014/11/22 13:12:22 njoly Exp $  */
 
 /*-
  * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.24 2014/11/09 17:48:08 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux32_misc.c,v 1.25 2014/11/22 13:12:22 njoly Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -42,6 +42,7 @@
 #include <sys/vfs_syscalls.h>
 #include <sys/ptrace.h>
 #include <sys/syscall.h>
+#include <sys/poll.h>
 
 #include <compat/netbsd32/netbsd32.h>
 #include <compat/netbsd32/netbsd32_syscallargs.h>
@@ -347,3 +348,39 @@
        NETBSD32TO64_UAP(len);
        return linux_sys_setdomainname(l, &ua, retval);
 }
+
+int
+linux32_sys_ppoll(struct lwp *l, const struct linux32_sys_ppoll_args *uap,
+    register_t *retval)
+{
+       /* {
+               syscallarg(netbsd32_pollfdp_t) fds;
+               syscallarg(u_int) nfds;
+               syscallarg(linux32_timespecp_t) timeout;
+               syscallarg(linux32_sigsetp_t) sigset;
+       } */
+       struct linux32_timespec lts0, *lts;
+       struct timespec ts0, *ts = NULL;
+       linux32_sigset_t lsigmask0, *lsigmask;
+       sigset_t sigmask0, *sigmask = NULL;
+       int error;
+
+       lts = SCARG_P32(uap, timeout);
+       if (lts) {
+               if ((error = copyin(lts, &lts0, sizeof(lts0))) != 0)
+                       return error;
+               linux32_to_native_timespec(&ts0, &lts0);
+               ts = &ts0;
+       }
+
+       lsigmask = SCARG_P32(uap, sigset);
+       if (lsigmask) {
+               if ((error = copyin(lsigmask, &lsigmask0, sizeof(lsigmask0))))
+                       return error;
+               linux32_to_native_sigset(&sigmask0, &lsigmask0);
+               sigmask = &sigmask0;
+       }
+
+       return pollcommon(retval, SCARG_P32(uap, fds), SCARG(uap, nfds),
+           ts, sigmask);
+}



Home | Main Index | Thread Index | Old Index