#include "c.h"
#include <sys/resource.h>
Go to the source code of this file.
◆ getrusage()
int getrusage |
( |
int |
who, |
|
|
struct rusage * |
rusage |
|
) |
| |
Definition at line 21 of file win32getrusage.c.
22{
23 FILETIME starttime;
24 FILETIME exittime;
25 FILETIME kerneltime;
26 FILETIME usertime;
27 ULARGE_INTEGER li;
28
30 {
31
32 errno = EINVAL;
33 return -1;
34 }
35
37 {
38 errno = EFAULT;
39 return -1;
40 }
42 if (GetProcessTimes(GetCurrentProcess(),
43 &starttime, &exittime, &kerneltime, &usertime) == 0)
44 {
46 return -1;
47 }
48
49
50 memcpy(&li, &kerneltime, sizeof(FILETIME));
51 li.QuadPart /= 10L;
54
55 memcpy(&li, &usertime, sizeof(FILETIME));
56 li.QuadPart /= 10L;
59
60 return 0;
61}
void _dosmaperr(unsigned long)
References _dosmaperr(), rusage::ru_stime, rusage::ru_utime, and RUSAGE_SELF.
Referenced by pg_rusage_init(), ResetUsage(), and ShowUsage().