minix/lib/libsys/getuptime.c

27 lines
680 B
C
Raw Normal View History

#include "sysutil.h"
2005-05-31 16:44:49 +02:00
/*===========================================================================*
* getuptime *
*===========================================================================*/
int getuptime(ticks, realtime, boottime)
clock_t *ticks; /* monotonic time in ticks */
clock_t *realtime; /* wall time in ticks */
time_t *boottime;
2005-05-31 16:44:49 +02:00
{
message m;
int s;
m.m_type = SYS_TIMES; /* request time information */
m.T_ENDPT = NONE; /* ignore process times */
s = _kernel_call(SYS_TIMES, &m);
2005-05-31 16:44:49 +02:00
*ticks = m.T_BOOT_TICKS;
*realtime = m.T_REAL_TICKS;
*boottime = m.T_BOOTTIME;
2005-05-31 16:44:49 +02:00
return(s);
}