Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/linux/common Fully emulate the Linux wait4(2) sys...
details: https://anonhg.NetBSD.org/src/rev/d7e2a5015465
branches: trunk
changeset: 472938:d7e2a5015465
user: thorpej <thorpej%NetBSD.org@localhost>
date: Thu May 13 01:00:50 1999 +0000
description:
Fully emulate the Linux wait4(2) system call, including the __WCLONE
flag (which is equivalent to our new WALTSIG).
diffstat:
sys/compat/linux/common/linux_misc.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diffs (42 lines):
diff -r 9df3d434d4c2 -r d7e2a5015465 sys/compat/linux/common/linux_misc.c
--- a/sys/compat/linux/common/linux_misc.c Thu May 13 00:59:03 1999 +0000
+++ b/sys/compat/linux/common/linux_misc.c Thu May 13 01:00:50 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: linux_misc.c,v 1.54 1999/05/05 20:01:03 thorpej Exp $ */
+/* $NetBSD: linux_misc.c,v 1.55 1999/05/13 01:00:50 thorpej Exp $ */
/*-
* Copyright (c) 1995, 1998 The NetBSD Foundation, Inc.
@@ -147,7 +147,7 @@
syscallarg(struct rusage *) rusage;
} */ *uap = v;
struct sys_wait4_args w4a;
- int error, *status, tstat;
+ int error, *status, tstat, options, linux_options;
caddr_t sg;
if (SCARG(uap, status) != NULL) {
@@ -156,9 +156,22 @@
} else
status = NULL;
+ linux_options = SCARG(uap, options);
+ options = 0;
+ if (linux_options &
+ ~(LINUX_WAIT4_WNOHANG|LINUX_WAIT4_WUNTRACED|LINUX_WAIT4_WCLONE))
+ return (EINVAL);
+
+ if (linux_options & LINUX_WAIT4_WNOHANG)
+ options |= WNOHANG;
+ if (linux_options & LINUX_WAIT4_WUNTRACED)
+ options |= WUNTRACED;
+ if (linux_options & LINUX_WAIT4_WCLONE)
+ options |= WALTSIG;
+
SCARG(&w4a, pid) = SCARG(uap, pid);
SCARG(&w4a, status) = status;
- SCARG(&w4a, options) = SCARG(uap, options);
+ SCARG(&w4a, options) = options;
SCARG(&w4a, rusage) = SCARG(uap, rusage);
if ((error = sys_wait4(p, &w4a, retval)))
Home |
Main Index |
Thread Index |
Old Index