Module Name: src
Committed By: dholland
Date: Wed Mar 16 00:50:41 UTC 2022
Modified Files:
src/lib/libc/sys: setpgid.2
Log Message:
setpgid.2: Mention that both child and parent need to call it.
Absence of this standard info was noticed by riastradh@.
To generate a diff of this commit:
cvs rdiff -u -r1.23 -r1.24 src/lib/libc/sys/setpgid.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/sys/setpgid.2
diff -u src/lib/libc/sys/setpgid.2:1.23 src/lib/libc/sys/setpgid.2:1.24
--- src/lib/libc/sys/setpgid.2:1.23 Fri Sep 19 16:02:58 2014
+++ src/lib/libc/sys/setpgid.2 Wed Mar 16 00:50:40 2022
@@ -1,4 +1,4 @@
-.\" $NetBSD: setpgid.2,v 1.23 2014/09/19 16:02:58 wiz Exp $
+.\" $NetBSD: setpgid.2,v 1.24 2022/03/16 00:50:40 dholland Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)setpgid.2 8.1 (Berkeley) 6/4/93
.\"
-.Dd December 18, 2003
+.Dd March 15, 2022
.Dt SETPGID 2
.Os
.Sh NAME
@@ -62,6 +62,14 @@ is used instead.
If the invoker is not the super-user, then the affected process
must have the same effective user-id as the invoker or be a descendant
of the invoking process.
+.Pp
+In general to set the process group of a newly forked subprocess, both
+the child and parent processes should call
+.Fn setpgid
+to ensure that the process group change takes effect in a timely
+fashion.
+One call will succeed and the other will fail, depending on process
+scheduling.
.Sh RETURN VALUES
.Fn setpgid
returns 0 when the operation was successful.