etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / gettimeofday.c
bloba7ecf4844fc9a74b1f7fea2b91bc8b5a59b27b98
1 /*
2 gettimeofday.c
3 */
5 #include <sys/cdefs.h>
6 #include "namespace.h"
7 #include <lib.h>
9 #include <string.h>
10 #include <sys/time.h>
12 int gettimeofday(struct timeval *__restrict tp, void *__restrict tzp)
14 message m;
16 memset(&m, 0, sizeof(m));
18 if (_syscall(PM_PROC_NR, PM_GETTIMEOFDAY, &m) < 0)
19 return -1;
21 tp->tv_sec = m.m_pm_lc_time.sec;
22 tp->tv_usec = m.m_pm_lc_time.nsec / 1000;
24 return 0;