Re: getrusage(2) manpage update

2014-12-08 Thread Philip Guenther
On Sat, Dec 6, 2014 at 1:25 PM, Kaspars Bankovskis
kasp...@bankovskis.net wrote:
 One flag was undocumented + some cleanup.

Looks good to me!


Philip Guenther



getrusage(2) manpage update

2014-12-06 Thread Kaspars Bankovskis
One flag was undocumented + some cleanup.

Index: getrusage.2
===
RCS file: /cvs/src/lib/libc/sys/getrusage.2,v
retrieving revision 1.15
diff -u -p -r1.15 getrusage.2
--- getrusage.2 17 Jul 2013 05:42:11 -  1.15
+++ getrusage.2 6 Dec 2014 21:16:51 -
@@ -36,22 +36,24 @@
 .Nm getrusage
 .Nd get information about resource utilization
 .Sh SYNOPSIS
-.Fd #include sys/resource.h
-.Pp
-.Fd #define RUSAGE_SELF0
-.Fd #define RUSAGE_CHILDREN(-1)
+.In sys/resource.h
 .Ft int
 .Fn getrusage int who struct rusage *rusage
 .Sh DESCRIPTION
 .Fn getrusage
-returns information describing the resources utilized by the current
-process, or all its terminated child processes.
-The
-.Fa who
-parameter is either
-.Dv RUSAGE_SELF
-or
-.Dv RUSAGE_CHILDREN .
+returns resource usage information for argument
+.Fa who ,
+which can be one of the following:
+.Pp
+.Bl -tag -width RUSAGE_CHILDREN -offset indent
+.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.
+.It Dv RUSAGE_THREAD
+Resources used by the current thread.
+.El
+.Pp
 The buffer to which
 .Fa rusage
 points will be filled in with
@@ -136,10 +138,7 @@ account only for real
 I/O; data supplied by the caching mechanism is charged only
 to the first process to read or write the data.
 .Sh RETURN VALUES
-Upon success, a value of zero is returned.
-Otherwise, \-1 is returned and
-.Va errno
-is set to indicate the error.
+.Rv -std
 .Sh ERRORS
 .Fn getrusage
 will fail if:
@@ -162,6 +161,10 @@ The
 .Fn getrusage
 function conforms to
 .St -p1003.1-2008 .
+.Pp
+The
+.Dv RUSAGE_THREAD
+flag is an extension to that.
 .Sh HISTORY
 A predecessor to
 .Fn getrusage ,
@@ -172,6 +175,11 @@ The
 .Fn getrusage
 system call first appeared in
 .Bx 4.1c .
+.Pp
+The
+.Dv RUSAGE_THREAD
+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.