Module Name: src
Committed By: njoly
Date: Sat Nov 22 13:12:22 UTC 2014
Modified Files:
src/sys/compat/linux32/arch/amd64: syscalls.master
src/sys/compat/linux32/common: linux32_misc.c
Log Message:
Add ppoll(2) for compat linux32.
To generate a diff of this commit:
cvs rdiff -u -r1.67 -r1.68 src/sys/compat/linux32/arch/amd64/syscalls.master
cvs rdiff -u -r1.24 -r1.25 src/sys/compat/linux32/common/linux32_misc.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/compat/linux32/arch/amd64/syscalls.master
diff -u src/sys/compat/linux32/arch/amd64/syscalls.master:1.67 src/sys/compat/linux32/arch/amd64/syscalls.master:1.68
--- src/sys/compat/linux32/arch/amd64/syscalls.master:1.67 Thu May 29 10:47:00 2014
+++ src/sys/compat/linux32/arch/amd64/syscalls.master Sat Nov 22 13:12:22 2014
@@ -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); }
Index: src/sys/compat/linux32/common/linux32_misc.c
diff -u src/sys/compat/linux32/common/linux32_misc.c:1.24 src/sys/compat/linux32/common/linux32_misc.c:1.25
--- src/sys/compat/linux32/common/linux32_misc.c:1.24 Sun Nov 9 17:48:08 2014
+++ src/sys/compat/linux32/common/linux32_misc.c Sat Nov 22 13:12:22 2014
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: linux32_misc
#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 @@ linux32_sys_setdomainname(struct lwp *l,
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, <s0, sizeof(lts0))) != 0)
+ return error;
+ linux32_to_native_timespec(&ts0, <s0);
+ 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);
+}