X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/9bccf70c0258c7cac2dcb80011b2a964d884c552..4bd07ac2140668789aa3ee8ec4dde4a3e0a3bba5:/bsd/man/man2/getrusage.2 diff --git a/bsd/man/man2/getrusage.2 b/bsd/man/man2/getrusage.2 index a361d1d36..c243f97e1 100644 --- a/bsd/man/man2/getrusage.2 +++ b/bsd/man/man2/getrusage.2 @@ -40,12 +40,15 @@ .Nm getrusage .Nd get information about resource utilization .Sh SYNOPSIS -.Fd #include .Fd #include +.Pp .Fd #define RUSAGE_SELF 0 .Fd #define RUSAGE_CHILDREN -1 .Ft int -.Fn getrusage "int who" "struct rusage *rusage" +.Fo getrusage +.Fa "int who" +.Fa "struct rusage *r_usage" +.Fc .Sh DESCRIPTION .Fn Getrusage returns information describing the resources utilized by the current @@ -57,14 +60,14 @@ parameter is either or .Dv RUSAGE_CHILDREN . The buffer to which -.Fa rusage +.Fa r_usage points will be filled in with the following structure: .Bd -literal 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 */ @@ -89,7 +92,7 @@ the total amount of time spent executing in user mode. the total amount of time spent in the system executing on behalf of the process(es). .It Fa ru_maxrss -the maximum resident set size utilized (in kilobytes). +the maximum resident set size utilized (in bytes). .It Fa ru_ixrss an \*(lqintegral\*(rq value indicating the amount of memory used by the text segment @@ -139,23 +142,33 @@ 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 +.Rv -std getrusage .Sh ERRORS -.Fn Getrusage -returns -1 on error. -The possible errors are: +The +.Fn getrusage +system call will fail if: .Bl -tag -width Er +.It Bq Er EFAULT +The address specified by the +.Fa r_usage +parameter is not in a valid part of the process address space. .It Bq Er EINVAL The .Fa who parameter is not a valid value. -.It Bq Er EFAULT -The address specified by the -.Fa rusage -parameter is not in a valid part of the process address space. .El +.Sh LEGACY SYNOPSIS +.Fd #include +.Fd #include +.Pp +The include file +.In sys/time.h +is necessary. .Sh SEE ALSO .Xr gettimeofday 2 , -.Xr wait 2 +.Xr wait 2 , +.Xr compat 5 .Sh BUGS There is no way to obtain information about a child process that has not yet terminated.