2005-07-19 15:21:51 +02:00
|
|
|
#include "sysutil.h"
|
2005-05-31 16:44:49 +02:00
|
|
|
|
|
|
|
/*===========================================================================*
|
|
|
|
* getuptime *
|
|
|
|
*===========================================================================*/
|
2013-03-29 22:48:22 +01:00
|
|
|
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 */
|
2006-03-03 10:44:55 +01:00
|
|
|
m.T_ENDPT = NONE; /* ignore process times */
|
2010-02-09 16:20:09 +01:00
|
|
|
s = _kernel_call(SYS_TIMES, &m);
|
2005-05-31 16:44:49 +02:00
|
|
|
*ticks = m.T_BOOT_TICKS;
|
2013-03-29 22:48:22 +01:00
|
|
|
*realtime = m.T_REAL_TICKS;
|
|
|
|
*boottime = m.T_BOOTTIME;
|
2005-05-31 16:44:49 +02:00
|
|
|
return(s);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|