custom message type for VM_INFO
[minix3.git] / lib / libsys / getuptime.c
blob0a977997c9df0d19aba8a326788077e359f91801
1 #include "sysutil.h"
3 /*===========================================================================*
4 * getuptime *
5 *===========================================================================*/
6 int getuptime(ticks, realtime, boottime)
7 clock_t *ticks; /* monotonic time in ticks */
8 clock_t *realtime; /* wall time in ticks */
9 time_t *boottime;
11 message m;
12 int s;
14 m.m_type = SYS_TIMES; /* request time information */
15 m.m_lsys_krn_sys_times.endpt = NONE; /* ignore process times */
16 s = _kernel_call(SYS_TIMES, &m);
17 *ticks = m.m_krn_lsys_sys_times.boot_ticks;
18 *realtime = m.m_krn_lsys_sys_times.real_ticks;
19 *boottime = m.m_krn_lsys_sys_times.boot_time;
20 return(s);