getrusage(2)
_________________________________________________________________
getrusage System Call
Get information about resource utilization.
_________________________________________________________________
SYNTAX
#include <sys/time.h>
#include <sys/resource.h>
int getrusage (who, rusage)
int who;
struct rusage * rusage;
PARAMETERS
who Identifies whether to return information about the
calling process or about the calling process's
acknowledged terminated children. Can have the
values RUSAGE_SELF and RUSAGE_CHILDREN.
rusage A pointer to an area in the calling process's
address space where the resource usage information
is to be written.
DESCRIPTION
Getrusage returns information describing the resources utilized
by the current process, or the sum of the resources utilized by
each of its acknowledged terminated children, depending on the
value of <who>. The rusage structure pointed to by <rusage> is
filled in with the information. See the description of the
rusage structure for the details of each field.
If an error occurs, <rusage> is unmodified.
ACCESS CONTROL
The argument <rusage> must point to an area in the calling
process's address space that is valid and has write access.
RETURN VALUE
DG/UX returns:
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
getrusage(2)
0 Successful completion.
-1 An error occurred. Errno is set to indicate the
error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EINVAL The <who> argument was not RUSAGE_SELF or
RUSAGE_CHILDREN.
EFAULT The <rusage> argument specifies an invalid area of
the calling process's address space or an area
which does not have read/write access.
SEE ALSO
The related system calls: gettimeofday, wait. m4:-:968 EOF in
argument list __b_fun(<< times (>>)long times (buffer)
struct tms * buffer; /* WRITE ONLY */
SUMMARY
Get process and child process times.
INCLUDE
#include <sys/types.h>
#include <sys/times.h>
PARAMETERS
buffer The address of a structure into which the times
are to be put.
DESCRIPTION
This system call fills in the structure pointed to by <buffer>
with time accounting information for the calling process and each
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
getrusage(2)
of its terminated child processes for which it has executed a
wait.
ACCESS CONTROL
The argument <buffer> must point to an area of the calling
process's address space that is valid and has write access.
RETURN VALUE
Upon successful completion,times returns the elapsed real-time,in
[CLK_TCK]ths of a second,since an arbitrary point in the past
(e.g., system start-up time). This point does not change from
one invocation of times to another. Hence,a single value
returned from this call is not meaningful; only the difference
between values returned at different times is meaningful.
If an error occurs,-1 is returned and errno is set to indicate
the error.
EXCEPTIONS
Errno may be set to one of the following error codes:
EFAULT <Buffer> points to an illegal address.
SEE ALSO
The related system calls: exec,fork,time,wait.
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)