diff options
author | Hector Chu <hectorchu@gmail.com> | 2009-11-30 11:53:11 -0800 |
---|---|---|
committer | Hector Chu <hectorchu@gmail.com> | 2009-11-30 11:53:11 -0800 |
commit | 8eabe8208c32050802c06abdc2baf49febf6fb7a (patch) | |
tree | 7ac62e529fdf4675e7449e7171ed7cc0a573e517 /src/lib9/time.c | |
parent | 2c880cf84880cfac9c667f48087c7c30d19b76ba (diff) | |
download | golang-8eabe8208c32050802c06abdc2baf49febf6fb7a.tar.gz |
Ports of lib9, libbio and libmach to Windows.
R=rsc
http://codereview.appspot.com/157159
Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/lib9/time.c')
-rw-r--r-- | src/lib9/time.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib9/time.c b/src/lib9/time.c index ab1b90560..720dd702e 100644 --- a/src/lib9/time.c +++ b/src/lib9/time.c @@ -25,13 +25,18 @@ THE SOFTWARE. #include <u.h> #include <sys/time.h> #include <time.h> +#ifndef __MINGW32__ #include <sys/resource.h> +#endif #define NOPLAN9DEFINES #include <libc.h> long p9times(long *t) { +#ifdef __MINGW32__ + memset(t, 0, 4*sizeof(long)); +#else struct rusage ru, cru; if(getrusage(0, &ru) < 0 || getrusage(-1, &cru) < 0) @@ -41,6 +46,7 @@ p9times(long *t) t[1] = ru.ru_stime.tv_sec*1000 + ru.ru_stime.tv_usec/1000; t[2] = cru.ru_utime.tv_sec*1000 + cru.ru_utime.tv_usec/1000; t[3] = cru.ru_stime.tv_sec*1000 + cru.ru_stime.tv_usec/1000; +#endif /* BUG */ return t[0]+t[1]+t[2]+t[3]; |