xref: /minix3/minix/lib/libc/sys/getitimer.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1 #include <sys/cdefs.h>
2 #include "namespace.h"
3 #include <lib.h>
4 
5 #include <string.h>
6 #include <sys/time.h>
7 
8 /*
9  * This is the implementation for the function to
10  * invoke the interval timer retrieval system call.
11  */
getitimer(int which,struct itimerval * value)12 int getitimer(int which, struct itimerval *value)
13 {
14   message m;
15 
16   memset(&m, 0, sizeof(m));
17   m.m_lc_pm_itimer.which = which;
18   m.m_lc_pm_itimer.value = 0;		/* only retrieve the timer */
19   m.m_lc_pm_itimer.ovalue = (vir_bytes)value;
20 
21   return _syscall(PM_PROC_NR, PM_ITIMER, &m);
22 }
23 
24 #if defined(__minix) && defined(__weak_alias)
25 __weak_alias(getitimer, __getitimer50)
26 #endif
27