sys_getrusage  [kernel/sys.c]


Gets current resource usage.

Arguments

eax 77
ebx It must be one of the following values:
RUSAGE_SELF     - get resource usage for parent process
RUSAGE_CHILDREN - get resource usage for child processes.
ecx Pointer to a rusage structure which will be filed with return information:

struc rusage
{

.ru_utime    timeval ; user time used
.ru_stime    timeval ; system time used
.ru_maxrss   rd 1 ; maximum resident set size
.ru_ixrss    rd 1 ; integral shared memory size
.ru_idrss    rd 1 ; integral unshared data size
.ru_isrss    rd 1 ; integral unshared stack size
.ru_minflt   rd 1 ; page reclaims
.ru_majflt   rd 1 ; page faults
.ru_nswap    rd 1 ; swaps
.ru_inblock  rd 1 ; block input operations
.ru_oublock  rd 1 ; block output operations
.ru_msgsnd   rd 1 ; messages sent
.ru_msgrcv   rd 1 ; messages received
.ru_nsignals rd 1 ; signals received
.ru_nvcsw    rd 1 ; voluntary context switches
.ru_nivcsw   rd 1 ; involuntary context switches
}

struc timeval
{
tv_sec      rd 1 ; seconds
tv_usec     rd 1 ; microseconds
}

Return values

If the system call succeeds the return value is 0.
If the system call fails the return value is one of the following errno values:

-EINVAL ebx is invalid.
-EFAULT ecx points outside the accessible address space.

Remarks

In Linux kernel versions before 2.6.9, if the disposition of SIGCHLD is set to SIG_IGN then the resource usages of child processes are automatically included in the value returned by RUSAGE_CHILDREN.

Compatibility

n/a