about summary refs log tree commit diff
path: root/src/misc/getrusage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/getrusage.c')
-rw-r--r--src/misc/getrusage.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/src/misc/getrusage.c b/src/misc/getrusage.c
index 1b8850f9..a5cbd757 100644
--- a/src/misc/getrusage.c
+++ b/src/misc/getrusage.c
@@ -2,19 +2,7 @@
 #include <string.h>
 #include "syscall.h"
 
-/* this is a huge hack to make up for the kernel's stupid 32bit time_t
- * without having to recopy the whole rusage structure ourselves.. */
-
 int getrusage(int who, struct rusage *ru)
 {
-	struct { long tv_sec, tv_usec; } ktv[2];
-	char *fakeaddr = ((char *)ru + sizeof(struct timeval [2]) - sizeof ktv);
-	if (syscall2(__NR_getrusage, who, (long)fakeaddr) < 0)
-		return -1;
-	memcpy(ktv, fakeaddr, sizeof ktv);
-	ru->ru_utime.tv_sec  = ktv[0].tv_sec;
-	ru->ru_utime.tv_usec = ktv[0].tv_usec;
-	ru->ru_stime.tv_sec  = ktv[1].tv_sec;
-	ru->ru_stime.tv_usec = ktv[1].tv_usec;
-	return 0;
+	return syscall(SYS_getrusage, who, ru);
 }