From: claudio Date: Wed, 17 Jul 2024 13:29:05 +0000 (+0000) Subject: Be clear that RUSAGE_CHILDREN only works for terminated children that have X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=f326d80655d10c29fbfb04dbfeb05fba84298739;p=openbsd Be clear that RUSAGE_CHILDREN only works for terminated children that have been waited for. If you SIG_IGN SIGCHLD or don't call any of the wait functions then RUSAGE_CHILDREN wont report anything. OK deraadt@ millert@ --- diff --git a/lib/libc/sys/getrusage.2 b/lib/libc/sys/getrusage.2 index aeaf5c9d124..35eccf70b98 100644 --- a/lib/libc/sys/getrusage.2 +++ b/lib/libc/sys/getrusage.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: getrusage.2,v 1.17 2015/02/28 21:51:57 bentley Exp $ +.\" $OpenBSD: getrusage.2,v 1.18 2024/07/17 13:29:05 claudio Exp $ .\" .\" Copyright (c) 1985, 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -29,7 +29,7 @@ .\" .\" @(#)getrusage.2 8.1 (Berkeley) 6/4/93 .\" -.Dd $Mdocdate: February 28 2015 $ +.Dd $Mdocdate: July 17 2024 $ .Dt GETRUSAGE 2 .Os .Sh NAME @@ -48,7 +48,10 @@ which can be one of the following: .It Dv RUSAGE_SELF Resources used by the current process. .It Dv RUSAGE_CHILDREN -Resources used by all the terminated children of the current process. +Resources used by all the terminated children of the current process which +were waited upon. +If the child is never waited for, the resource information for the child +process is discarded. .It Dv RUSAGE_THREAD Resources used by the current thread. .El @@ -186,4 +189,4 @@ flag has been available since .Ox 4.8 . .Sh BUGS There is no way to obtain information about a child process -that has not yet terminated. +that has not yet terminated or has not been waited for by the parent.