summaryrefslogtreecommitdiff
path: root/sys/compat/linux
diff options
context:
space:
mode:
authorpooka <pooka@NetBSD.org>2012-09-19 21:19:14 +0000
committerpooka <pooka@NetBSD.org>2012-09-19 21:19:14 +0000
commit080e7aaa17dddbdcd381c9a8c4d6601bc410686c (patch)
treef3c14fbc16d6c9112de30e600d9c0bd5f3e8624a /sys/compat/linux
parent1a6fd7132be11954df65db5a0be85d59192765b0 (diff)
emulate ppoll which is essentially our pollts
Diffstat (limited to 'sys/compat/linux')
-rw-r--r--sys/compat/linux/arch/alpha/syscalls.master6
-rw-r--r--sys/compat/linux/arch/amd64/syscalls.master6
-rw-r--r--sys/compat/linux/arch/arm/syscalls.master6
-rw-r--r--sys/compat/linux/arch/i386/syscalls.master6
-rw-r--r--sys/compat/linux/arch/m68k/syscalls.master6
-rw-r--r--sys/compat/linux/arch/mips/syscalls.master6
-rw-r--r--sys/compat/linux/arch/powerpc/syscalls.master6
-rw-r--r--sys/compat/linux/common/linux_misc.c42
8 files changed, 68 insertions, 16 deletions
diff --git a/sys/compat/linux/arch/alpha/syscalls.master b/sys/compat/linux/arch/alpha/syscalls.master
index 57e6b2cff82..6c52ee959cd 100644
--- a/sys/compat/linux/arch/alpha/syscalls.master
+++ b/sys/compat/linux/arch/alpha/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.76 2011/11/18 04:03:50 christos Exp $
+ $NetBSD: syscalls.master,v 1.77 2012/09/19 21:19:14 pooka Exp $
;
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -712,7 +712,9 @@
461 UNIMPL fchmodat
462 UNIMPL faccessat
463 UNIMPL pselect6
-464 UNIMPL ppoll
+464 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
465 UNIMPL unshare
466 STD { int|linux_sys||set_robust_list( \
struct linux_robust_list_head *head, size_t len); }
diff --git a/sys/compat/linux/arch/amd64/syscalls.master b/sys/compat/linux/arch/amd64/syscalls.master
index 242f3429c6f..c2f50fdc995 100644
--- a/sys/compat/linux/arch/amd64/syscalls.master
+++ b/sys/compat/linux/arch/amd64/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.40 2011/11/18 04:03:50 christos Exp $
+ $NetBSD: syscalls.master,v 1.41 2012/09/19 21:19:14 pooka Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -476,7 +476,9 @@
268 UNIMPL fchmodat
269 UNIMPL faccessat
270 UNIMPL pselect6
-271 UNIMPL ppoll
+271 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
272 UNIMPL unshare
273 STD { int|linux_sys||set_robust_list( \
struct linux_robust_list_head *head, size_t len); }
diff --git a/sys/compat/linux/arch/arm/syscalls.master b/sys/compat/linux/arch/arm/syscalls.master
index 5f71b6951b6..2d7c596a3d9 100644
--- a/sys/compat/linux/arch/arm/syscalls.master
+++ b/sys/compat/linux/arch/arm/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.48 2011/11/18 04:03:50 christos Exp $
+ $NetBSD: syscalls.master,v 1.49 2012/09/19 21:19:14 pooka Exp $
; Derived from sys/compat/linux/arch/*/syscalls.master
; and from Linux 2.4.12 arch/arm/kernel/calls.S
@@ -517,7 +517,9 @@
333 UNIMPL fchmodat
334 UNIMPL faccessat
335 UNIMPL pselect6
-336 UNIMPL ppoll
+336 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
337 UNIMPL unshare
338 STD { int|linux_sys||set_robust_list( \
struct linux_robust_list_head *head, size_t len); }
diff --git a/sys/compat/linux/arch/i386/syscalls.master b/sys/compat/linux/arch/i386/syscalls.master
index 5709cfafb0a..e7eec6d204b 100644
--- a/sys/compat/linux/arch/i386/syscalls.master
+++ b/sys/compat/linux/arch/i386/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.107 2011/11/18 04:03:50 christos Exp $
+ $NetBSD: syscalls.master,v 1.108 2012/09/19 21:19:14 pooka Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -490,7 +490,9 @@
306 UNIMPL fchmodat
307 UNIMPL faccessat
308 UNIMPL pselect6
-309 UNIMPL ppoll
+309 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
310 UNIMPL unshare
311 STD { int|linux_sys||set_robust_list( \
struct linux_robust_list_head *head, size_t len); }
diff --git a/sys/compat/linux/arch/m68k/syscalls.master b/sys/compat/linux/arch/m68k/syscalls.master
index ca5d8acf0f4..b3963ba49e5 100644
--- a/sys/compat/linux/arch/m68k/syscalls.master
+++ b/sys/compat/linux/arch/m68k/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.73 2011/11/18 04:03:50 christos Exp $
+ $NetBSD: syscalls.master,v 1.74 2012/09/19 21:19:14 pooka Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -498,7 +498,9 @@
299 UNIMPL fchmodat
300 UNIMPL faccessat
301 UNIMPL pselect6
-302 UNIMPL ppoll
+302 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
303 UNIMPL unshare
304 STD { int|linux_sys||set_robust_list( \
struct linux_robust_list_head *head, size_t len); }
diff --git a/sys/compat/linux/arch/mips/syscalls.master b/sys/compat/linux/arch/mips/syscalls.master
index daae2bcc439..25a01fd570c 100644
--- a/sys/compat/linux/arch/mips/syscalls.master
+++ b/sys/compat/linux/arch/mips/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.43 2011/11/18 04:03:51 christos Exp $
+ $NetBSD: syscalls.master,v 1.44 2012/09/19 21:19:15 pooka Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -487,7 +487,9 @@
299 UNIMPL fchmodat
300 UNIMPL faccessat
301 UNIMPL pselect6
-302 UNIMPL ppoll
+302 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
303 UNIMPL unshare
304 UNIMPL splice
305 UNIMPL sync_file_range
diff --git a/sys/compat/linux/arch/powerpc/syscalls.master b/sys/compat/linux/arch/powerpc/syscalls.master
index 7c463b28ec0..c778bb9d866 100644
--- a/sys/compat/linux/arch/powerpc/syscalls.master
+++ b/sys/compat/linux/arch/powerpc/syscalls.master
@@ -1,4 +1,4 @@
- $NetBSD: syscalls.master,v 1.50 2011/11/18 04:03:51 christos Exp $
+ $NetBSD: syscalls.master,v 1.51 2012/09/19 21:19:15 pooka Exp $
; @(#)syscalls.master 8.1 (Berkeley) 7/19/93
@@ -476,7 +476,9 @@
278 UNIMPL spu_run
279 UNIMPL spu_create
280 UNIMPL pselect6
-281 UNIMPL ppoll
+281 STD { int|linux_sys||ppoll(struct pollfd *fds, int nfds, \
+ struct linux_timespec *timeout, \
+ linux_sigset_t *sigset); }
282 UNIMPL unshare
283 UNIMPL splice
284 UNIMPL tee
diff --git a/sys/compat/linux/common/linux_misc.c b/sys/compat/linux/common/linux_misc.c
index 2be0741b870..8a28c3c83b6 100644
--- a/sys/compat/linux/common/linux_misc.c
+++ b/sys/compat/linux/common/linux_misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $ */
+/* $NetBSD: linux_misc.c,v 1.220 2012/09/19 21:19:15 pooka Exp $ */
/*-
* Copyright (c) 1995, 1998, 1999, 2008 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.220 2012/09/19 21:19:15 pooka Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -73,6 +73,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp
#include <sys/mbuf.h>
#include <sys/mman.h>
#include <sys/mount.h>
+#include <sys/poll.h>
#include <sys/prot.h>
#include <sys/reboot.h>
#include <sys/resource.h>
@@ -119,6 +120,7 @@ __KERNEL_RCSID(0, "$NetBSD: linux_misc.c,v 1.219 2011/10/14 09:23:28 hannken Exp
#include <compat/linux/common/linux_ptrace.h>
#include <compat/linux/common/linux_reboot.h>
#include <compat/linux/common/linux_emuldata.h>
+#include <compat/linux/common/linux_sched.h>
#include <compat/linux/linux_syscallargs.h>
@@ -920,6 +922,42 @@ linux_select1(struct lwp *l, register_t *retval, int nfds, fd_set *readfds,
return 0;
}
+int
+linux_sys_ppoll(struct lwp *l,
+ const struct linux_sys_ppoll_args *uap, register_t *retval)
+{
+ /* {
+ syscallarg(struct pollfd *) fds;
+ syscallarg(int) nfds;
+ syscallarg(struct linux_timespec *) timeout;
+ syscallarg(linux_sigset_t *) sigset;
+ } */
+ struct linux_timespec lts0, *lts;
+ struct timespec ts0, *ts = NULL;
+ linux_sigset_t lsigmask0, *lsigmask;
+ sigset_t sigmask0, *sigmask = NULL;
+ int error;
+
+ lts = SCARG(uap, timeout);
+ if (lts) {
+ if ((error = copyin(lts, &lts0, sizeof(lts0))) != 0)
+ return error;
+ linux_to_native_timespec(&ts0, &lts0);
+ ts = &ts0;
+ }
+
+ lsigmask = SCARG(uap, sigset);
+ if (lsigmask) {
+ if ((error = copyin(lsigmask, &lsigmask0, sizeof(lsigmask0))))
+ return error;
+ linux_to_native_sigset(&sigmask0, &lsigmask0);
+ sigmask = &sigmask0;
+ }
+
+ return pollcommon(retval, SCARG(uap, fds), SCARG(uap, nfds),
+ ts, sigmask);
+}
+
/*
* Set the 'personality' (emulation mode) for the current process. Only
* accept the Linux personality here (0). This call is needed because