Module Name: src
Committed By: christos
Date: Thu Nov 10 17:07:14 UTC 2016
Modified Files:
src/sys/kern: kern_exit.c
src/sys/sys: wait.h
Log Message:
GC WOPTSCHECKED, define macros for the select opts and all the valid opts.
The linux compat flags are not part of X/Open.
To generate a diff of this commit:
cvs rdiff -u -r1.265 -r1.266 src/sys/kern/kern_exit.c
cvs rdiff -u -r1.32 -r1.33 src/sys/sys/wait.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/kern_exit.c
diff -u src/sys/kern/kern_exit.c:1.265 src/sys/kern/kern_exit.c:1.266
--- src/sys/kern/kern_exit.c:1.265 Tue Nov 8 19:30:17 2016
+++ src/sys/kern/kern_exit.c Thu Nov 10 12:07:14 2016
@@ -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 @@ find_stopped_child(struct proc *parent,
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.
Index: src/sys/sys/wait.h
diff -u src/sys/sys/wait.h:1.32 src/sys/sys/wait.h:1.33
--- src/sys/sys/wait.h:1.32 Sat Nov 5 19:49:59 2016
+++ src/sys/sys/wait.h Thu Nov 10 12:07:14 2016
@@ -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: */
/*