Back to index

glibc  2.9
Defines | Functions
vtimes.c File Reference
#include <stddef.h>
#include <sys/vtimes.h>
#include <sys/resource.h>

Go to the source code of this file.

Defines

#define TIMEVAL_TO_VTIMES(tv)

Functions

static int vtimes_one (struct vtimes *vt, enum __rusage_who who)
int vtimes (struct vtimes *current, struct vtimes *child)

Define Documentation

#define TIMEVAL_TO_VTIMES (   tv)
Value:
((tv.tv_sec * VTIMES_UNITS_PER_SECOND) + \
   (tv.tv_usec * VTIMES_UNITS_PER_SECOND / 1000000))

Definition at line 25 of file vtimes.c.


Function Documentation

int vtimes ( struct vtimes current,
struct vtimes child 
)

Definition at line 57 of file vtimes.c.

{
  if (vtimes_one (current, RUSAGE_SELF) < 0
      || vtimes_one (child, RUSAGE_CHILDREN) < 0)
    return -1;
  return 0;
}

Here is the call graph for this function:

static int vtimes_one ( struct vtimes vt,
enum __rusage_who  who 
) [static]

Definition at line 32 of file vtimes.c.

{
  if (vt != NULL)
    {
      struct rusage usage;

      if (__getrusage (who, &usage) < 0)
       return -1;

      vt->vm_utime = TIMEVAL_TO_VTIMES (usage.ru_utime);
      vt->vm_stime = TIMEVAL_TO_VTIMES (usage.ru_stime);
      vt->vm_idsrss = usage.ru_idrss + usage.ru_isrss;
      vt->vm_majflt = usage.ru_majflt;
      vt->vm_minflt = usage.ru_minflt;
      vt->vm_nswap = usage.ru_nswap;
      vt->vm_inblk = usage.ru_inblock;
      vt->vm_oublk = usage.ru_oublock;
    }
  return 0;
}

Here is the call graph for this function:

Here is the caller graph for this function: