diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-03-20 00:16:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-03-20 00:16:43 -0400 |
commit | aa398f56fa398f2202b04e82c67f822f3233786f (patch) | |
tree | 7833c046c55b3d2b67c66433bacfa429a650d310 /src/misc/getrusage.c | |
parent | be82e122bf37fdcd1766d1ed220f0300b30ab6a3 (diff) | |
download | musl-aa398f56fa398f2202b04e82c67f822f3233786f.tar.gz musl-aa398f56fa398f2202b04e82c67f822f3233786f.tar.bz2 musl-aa398f56fa398f2202b04e82c67f822f3233786f.tar.xz musl-aa398f56fa398f2202b04e82c67f822f3233786f.zip |
global cleanup to use the new syscall interface
Diffstat (limited to 'src/misc/getrusage.c')
-rw-r--r-- | src/misc/getrusage.c | 14 |
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); } |