Module Name: src Committed By: christos Date: Wed Apr 6 03:50:03 UTC 2016
Modified Files: src/lib/libc/gen: waitid.c src/lib/libc/sys: wait.2 Log Message: - clarify si_signo difference for waitid and wait6 as per POSIX. - implement it. - document WIFCONTINUED To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/lib/libc/gen/waitid.c cvs rdiff -u -r1.29 -r1.30 src/lib/libc/sys/wait.2 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libc/gen/waitid.c diff -u src/lib/libc/gen/waitid.c:1.2 src/lib/libc/gen/waitid.c:1.3 --- src/lib/libc/gen/waitid.c:1.2 Sat Apr 2 21:49:51 2016 +++ src/lib/libc/gen/waitid.c Tue Apr 5 23:50:03 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: waitid.c,v 1.2 2016/04/03 01:49:51 christos Exp $ */ +/* $NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $ */ /*- * Copyright (c) 2016 The NetBSD Foundation, Inc. @@ -29,7 +29,7 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__RCSID("$NetBSD: waitid.c,v 1.2 2016/04/03 01:49:51 christos Exp $"); +__RCSID("$NetBSD: waitid.c,v 1.3 2016/04/06 03:50:03 christos Exp $"); #include "namespace.h" #include <sys/types.h> @@ -57,6 +57,8 @@ waitid(idtype_t idtype, id_t id, siginfo memset(info, 0, sizeof(*info)); /*FALLTHROUGH*/ default: + if (info != NULL && info->si_signo != 0) + info->si_signo = SIGCHLD; return 0; } } Index: src/lib/libc/sys/wait.2 diff -u src/lib/libc/sys/wait.2:1.29 src/lib/libc/sys/wait.2:1.30 --- src/lib/libc/sys/wait.2:1.29 Mon Apr 4 09:13:09 2016 +++ src/lib/libc/sys/wait.2 Tue Apr 5 23:50:03 2016 @@ -1,4 +1,4 @@ -.\" $NetBSD: wait.2,v 1.29 2016/04/04 13:13:09 wiz Exp $ +.\" $NetBSD: wait.2,v 1.30 2016/04/06 03:50:03 christos Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)wait.2 8.2 (Berkeley) 4/19/94 .\" -.Dd April 2, 2016 +.Dd April 5, 2016 .Dt WAIT 2 .Os .Sh NAME @@ -435,7 +435,12 @@ structure is returned with the .Fa si_signo field set to .Dv SIGCHLD -and the +for +.Fn waitid +as required by POSIX and to the delivering signal +for +.Fn wait6 . +The .Fa si_pid field set to the process ID of the process reporting status. For the exited process, the @@ -508,6 +513,14 @@ This macro can be true only if the wait option or if the child process is being traced (see .Xr ptrace 2 ) . +.It Fn WIFCONTINUED status +True if the process has not terminated, but has been continued via the +delivery of the +.Dv SIGCONT +signal. +This macro can be true only if the wait call specified the +.Dv WCONTINUED +option. .El .Pp Depending on the values of those macros, the following macros