Module Name: src Committed By: martin Date: Sat Aug 12 12:53:18 UTC 2023
Modified Files: src/share/man/man7 [netbsd-10]: signal.7 Log Message: Pull up following revision(s) (requested by riastradh in ticket #325): share/man/man7/signal.7: revision 1.27 share/man/man7/signal.7: revision 1.28 signal(7): Clarify quirky SysV-inspired SIGCHLD semantics. Suggest a portable alternative approach for detaching subprocesses. Break wall of text into paragraphs while here. signal(7): Clarify semantics of SIGCHLD with SIG_IGN or SA_NOCLDWAIT. The semantics is not just a nonportable hack for SysV compatibility; it is enshrined in POSIX. Related: PR 57527 To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.26.4.1 src/share/man/man7/signal.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man7/signal.7 diff -u src/share/man/man7/signal.7:1.26 src/share/man/man7/signal.7:1.26.4.1 --- src/share/man/man7/signal.7:1.26 Sun May 30 07:17:01 2021 +++ src/share/man/man7/signal.7 Sat Aug 12 12:53:17 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: signal.7,v 1.26 2021/05/30 07:17:01 dholland Exp $ +.\" $NetBSD: signal.7,v 1.26.4.1 2023/08/12 12:53:17 martin Exp $ .\" .\" Copyright (c) 1999, 2016 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -401,18 +401,25 @@ immediate children exits and can be wait .Xr wait 2 family of functions. The default action is to do nothing. -As a special case hack, if +.Pp +As a special case, if a child exits when its parent process has .Dv SIGCHLD -is ignored (not merely blocked) when a process is -.Em created , -it is detached from its parent immediately so it need not be waited -for. -This behavior is a System V historic wart, implemented in -.Nx -only for compatibility. -It is not portable, not recommended, and should not be used by new -code. -.\" XXX should refer to something that can be used by new code... +ignored +.Pq not merely blocked +by having its signal handler set to +.Dv SIG_IGN , +or if the signal action has the +.Dv SA_NOCLDWAIT +flag set +.Pq Xr sigaction 2 , +then the child is detached so that +.Xr wait 2 +in the parent will wait for +.Em all +children to exit and then fail with +.Er ECHILD +without returning any information about any specific child processes. +.Pp The number for .Dv SIGCHLD is\~20.