getrusage.2: Description of maintained fields

These descriptions are taken from NetBSD 5.0's getrusage(2).

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Mark Hills 2010-04-25 21:42:31 +01:00 committed by Michael Kerrisk
parent 2419294d22
commit d1cd1e055a
1 changed files with 51 additions and 18 deletions

View File

@ -89,6 +89,57 @@ struct rusage {
};
.fi
.in
.PP
Not all fields are completed; unmaintained fields are set to zero by
the kernel. The fields are interpreted as follows:
.TP
.I ru_utime
the total amount of time spent executing in user mode.
.TP
.I ru_stime
the total amount of time spent in the system executing on behalf
of the process(es).
.TP
.IR ru_maxrss " (unmaintained)"
.TP
.IR ru_ixrss " (unmaintained)"
.TP
.IR ru_idrss " (unmaintained)"
.TP
.IR ru_isrss " (unmaintained)"
.TP
.I ru_minflt
the number of page faults serviced without any I/O activity; here
I/O activity is avoided by \*(lqreclaiming\*(rq a page frame from
the list of pages awaiting reallocation.
.TP
.I ru_majflt
the number of page faults serviced that required I/O activity.
.TP
.IR ru_nswap " (unmaintained)"
.TP
.IR ru_inblock " (since Linux 2.6.22)"
the number of times the file system had to perform input.
.TP
.IR ru_oublock " (since Linux 2.6.22)"
the number of times the file system had to perform output.
.TP
.IR ru_msgsnd " (unmaintained)"
.TP
.IR ru_msgrcv " (unmaintained)"
.TP
.IR ru_nsignals " (unmaintained)"
.TP
.IR ru_nvcsw " (since Linux 2.6)"
the number of times a context switch resulted due to a process
voluntarily giving up the processor before its time slice was
completed (usually to await availability of a resource).
.TP
.IR ru_nivcsw " (since Linux 2.6)"
the number of times a context switch resulted due to a higher
priority process becoming runnable or because the current process
exceeded its time slice.
.PP
.SH "RETURN VALUE"
On success, zero is returned.
On error, \-1 is returned, and
@ -140,24 +191,6 @@ This nonconformance is rectified in Linux 2.6.9 and later.
.LP
The structure definition shown at the start of this page
was taken from 4.3BSD Reno.
Not all fields are meaningful under Linux.
In Linux 2.4 only the fields
.IR ru_utime ,
.IR ru_stime ,
.IR ru_minflt ,
and
.I ru_majflt
are maintained.
Since Linux 2.6,
.I ru_nvcsw
and
.I ru_nivcsw
are also maintained.
Since Linux 2.6.22,
.I ru_inblock
and
.I ru_oublock
are also maintained.
See also the description of
.IR /proc/PID/stat