etc/services - sync with NetBSD-8
[minix.git] / minix / lib / libc / sys / clock_getres.c
blob5c19d8c37f8ce8f19324607a7c95b20baa844cf1
1 #include <sys/cdefs.h>
2 #include <lib.h>
3 #include "namespace.h"
5 #include <string.h>
6 #include <sys/time.h>
8 #ifdef __weak_alias
9 __weak_alias(clock_getres, __clock_getres50);
10 #endif
12 int clock_getres(clockid_t clock_id, struct timespec *res)
14 message m;
16 memset(&m, 0, sizeof(m));
17 m.m_lc_pm_time.clk_id = clock_id;
19 if (_syscall(PM_PROC_NR, PM_CLOCK_GETRES, &m) < 0)
20 return -1;
22 res->tv_sec = m.m_pm_lc_time.sec;
23 res->tv_nsec = m.m_pm_lc_time.nsec;
25 return 0;