libc, libutil: remove compat hacks
[minix.git] / lib / libc / sys-minix / gettimeofday.c
blob352c596124bee49e31d85b3e5286e6ca960d29f2
1 /*
2 gettimeofday.c
3 */
5 #include <sys/cdefs.h>
6 #include "namespace.h"
7 #include <lib.h>
9 #include <sys/time.h>
11 #ifdef __weak_alias
12 __weak_alias(gettimeofday, _gettimeofday)
13 #endif
15 int gettimeofday(struct timeval *__restrict tp, void *__restrict tzp)
17 message m;
19 if (_syscall(PM_PROC_NR, GETTIMEOFDAY, &m) < 0)
20 return -1;
22 tp->tv_sec = m.m2_l1;
23 tp->tv_usec = m.m2_l2;
25 return 0;