Source-Changes-HG archive

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

[src/trunk]: src/sys GC WOPTSCHECKED, define macros for the select opts and a...



details:   https://anonhg.NetBSD.org/src/rev/a4348a9a14a1
branches:  trunk
changeset: 348827:a4348a9a14a1
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 10 17:07:14 2016 +0000

description:
GC WOPTSCHECKED, define macros for the select opts and all the valid opts.
The linux compat flags are not part of X/Open.

diffstat:

 sys/kern/kern_exit.c |  10 ++++------
 sys/sys/wait.h       |  20 ++++++++++----------
 2 files changed, 14 insertions(+), 16 deletions(-)

diffs (77 lines):

diff -r 9b48d5cc7d78 -r a4348a9a14a1 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Thu Nov 10 17:00:51 2016 +0000
+++ b/sys/kern/kern_exit.c      Thu Nov 10 17:07:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.265 2016/11/09 00:30:17 kre Exp $      */
+/*     $NetBSD: kern_exit.c,v 1.266 2016/11/10 17:07:14 christos Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.265 2016/11/09 00:30:17 kre Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_exit.c,v 1.266 2016/11/10 17:07:14 christos Exp $");
 
 #include "opt_ktrace.h"
 #include "opt_dtrace.h"
@@ -1004,14 +1004,12 @@
 
        KASSERT(mutex_owned(proc_lock));
 
-       if (options & ~(WUNTRACED|WNOHANG|WALTSIG|WALLSIG|WTRAPPED|WEXITED|
-           WNOWAIT|WCONTINUED)
-           && !(options & WOPTSCHECKED)) {
+       if (options & ~WALLOPTS) {
                *child_p = NULL;
                return EINVAL;
        }
 
-       if ((options & (WEXITED|WUNTRACED|WCONTINUED|WTRAPPED)) == 0) {
+       if ((options & WSELECTOPTS) == 0) {
                /*
                 * We will be unable to find any matching processes,
                 * because there are no known events to look for.
diff -r 9b48d5cc7d78 -r a4348a9a14a1 sys/sys/wait.h
--- a/sys/sys/wait.h    Thu Nov 10 17:00:51 2016 +0000
+++ b/sys/sys/wait.h    Thu Nov 10 17:07:14 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wait.h,v 1.32 2016/11/05 23:49:59 christos Exp $       */
+/*     $NetBSD: wait.h,v 1.33 2016/11/10 17:07:14 christos Exp $       */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993, 1994
@@ -100,23 +100,23 @@
 #define        WTRAPPED        0x00000040      /* Wait for a process to hit a trap or
                                           a breakpoint. */
 
+#define        WNOWAIT         0x00010000      /* Don't mark child 'P_WAITED' */
+#define        WNOZOMBIE       0x00020000      /* Ignore zombies */
+
+#ifdef _NETBSD_SOURCE
 /*
  * These are the Linux names of some of the above flags, for compatibility
  * with Linux's clone(2) API.
  */
 #define        __WCLONE        WALTSIG
 #define        __WALL          WALLSIG
+#endif /* _NETBSD_SOURCE */
 
-/*
- * These bits are used in order to support SVR4 (etc) functionality
- * without replicating sys_wait4 5 times.
- */
-#define        WNOWAIT         0x00010000      /* Don't mark child 'P_WAITED' */
-#define        WNOZOMBIE       0x00020000      /* Ignore zombies */
-#define        WOPTSCHECKED    0x00040000      /* Compat call, options verified */
-#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
+#ifdef _KERNEL
+#define WSELECTOPTS    (WEXITED|WUNTRACED|WCONTINUED|WTRAPPED)
+#define WALLOPTS       (WNOHANG|WALTSIG|WALLSIG|WNOWAIT|WNOZOMBIE|WSELECTOPTS)
+#endif /* _KERNEL */
 
-#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
 /* POSIX extensions and 4.2/4.3 compatibility: */
 
 /*



Home | Main Index | Thread Index | Old Index