diff options
Diffstat (limited to 'lib/libc/sys/getrusage.2')
-rw-r--r-- | lib/libc/sys/getrusage.2 | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/lib/libc/sys/getrusage.2 b/lib/libc/sys/getrusage.2 index 9d1657c..0f92569 100644 --- a/lib/libc/sys/getrusage.2 +++ b/lib/libc/sys/getrusage.2 @@ -38,6 +38,7 @@ .Nm getrusage .Nd get information about resource utilization .Sh SYNOPSIS +.Fd #include <sys/types.h> .Fd #include <sys/time.h> .Fd #include <sys/resource.h> .Fd #define RUSAGE_SELF 0 @@ -62,7 +63,7 @@ the following structure: struct rusage { struct timeval ru_utime; /* user time used */ struct timeval ru_stime; /* system time used */ - long ru_maxrss; /* integral max resident set size */ + long ru_maxrss; /* max resident set size */ long ru_ixrss; /* integral shared text memory size */ long ru_idrss; /* integral unshared data size */ long ru_isrss; /* integral unshared stack size */ @@ -93,6 +94,9 @@ an \*(lqintegral\*(rq value indicating the amount of memory used by the text segment that was also shared among other processes. This value is expressed in units of kilobytes * ticks-of-execution. +Ticks are statistics clock ticks. +The statistics clock has a frequency of +sysconf(_SC_CLOCK_TCK) ticks per second. .It Fa ru_idrss an integral value of the amount of unshared memory residing in the data segment of a process (expressed in units of @@ -137,10 +141,16 @@ and 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 +Uponsuccessful completion, +.Fn getrusage +returns 0. Otherwise, a value of -1 is returned and +.Va errno +is set to indicate the error. .Sh ERRORS -.Fn Getrusage -returns -1 on error. -The possible errors are: +The +.Fn getrusage +function will fail if: .Bl -tag -width Er .It Bq Er EINVAL The @@ -153,12 +163,13 @@ parameter is not in a valid part of the process address space. .El .Sh SEE ALSO .Xr gettimeofday 2 , -.Xr wait 2 +.Xr wait 2 , +.Xr clocks 7 .Sh BUGS There is no way to obtain information about a child process that has not yet terminated. .Sh HISTORY The -.Nm +.Fn getrusage function call appeared in .Bx 4.2 . |