Source-Changes-HG archive

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

[src/trunk]: src/sys Add `WALLSIG' which causes wait4(2) to wait for all proc...



details:   https://anonhg.NetBSD.org/src/rev/0610928ae331
branches:  trunk
changeset: 512882:0610928ae331
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Jul 18 19:10:26 2001 +0000

description:
Add `WALLSIG' which causes wait4(2) to wait for all processes, regardless
of exit signal.  Add Linux-compatible aliases __WCLONE (for WALTSIG) and
__WALL (for WALLSIG), for compatibility with the Linux clone(2) API.

diffstat:

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

diffs (49 lines):

diff -r e33d474c9750 -r 0610928ae331 sys/kern/kern_exit.c
--- a/sys/kern/kern_exit.c      Wed Jul 18 18:29:17 2001 +0000
+++ b/sys/kern/kern_exit.c      Wed Jul 18 19:10:26 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_exit.c,v 1.90 2001/03/05 20:38:21 fvdl Exp $      */
+/*     $NetBSD: kern_exit.c,v 1.91 2001/07/18 19:10:27 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -428,8 +428,9 @@
                 * if WALTSIG is set; wait for processes with p_exitsig ==
                 * SIGCHLD only if WALTSIG is clear.
                 */
-               if ((SCARG(uap, options) & WALTSIG) ?
-                   (p->p_exitsig == SIGCHLD) : (P_EXITSIG(p) != SIGCHLD))
+               if (((SCARG(uap, options) & WALLSIG) == 0) &&
+                   ((SCARG(uap, options) & WALTSIG) ?
+                    (p->p_exitsig == SIGCHLD) : (P_EXITSIG(p) != SIGCHLD)))
                        continue;
 
                nfound++;
diff -r e33d474c9750 -r 0610928ae331 sys/sys/wait.h
--- a/sys/sys/wait.h    Wed Jul 18 18:29:17 2001 +0000
+++ b/sys/sys/wait.h    Wed Jul 18 19:10:26 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wait.h,v 1.16 2001/06/11 01:50:57 wiz Exp $    */
+/*     $NetBSD: wait.h,v 1.17 2001/07/18 19:10:26 thorpej Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1993, 1994
@@ -85,7 +85,17 @@
 #define        WALTSIG         0x00000004      /* wait for processes that exit
                                           with an alternate signal (i.e.
                                           not SIGCHLD) */
-#endif
+#define        WALLSIG         0x00000008      /* wait for processes that exit
+                                          with any signal, i.e. SIGCHLD
+                                          and alternates */
+
+/*
+ * 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 /* ! _POSIX_SOURCE */
 
 #ifndef _POSIX_SOURCE
 /* POSIX extensions and 4.2/4.3 compatibility: */



Home | Main Index | Thread Index | Old Index