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)
|
2014-05-22 11:32:14 +02:00
|
|
|
clock_t *ticks; /* monotonic time in ticks */
|
|
|
|
clock_t *realtime; /* wall time in ticks */
|
2013-03-29 22:48:22 +01:00
|
|
|
time_t *boottime;
|
2005-05-31 16:44:49 +02:00
|
|
|
{
|
|
|
|
message m;
|
|
|
|
int s;
|
|
|
|
|
2014-05-22 11:32:14 +02:00
|
|
|
m.m_type = SYS_TIMES; /* request time information */
|
|
|
|
m.m_lsys_krn_sys_times.endpt = NONE; /* ignore process times */
|
2010-02-09 16:20:09 +01:00
|
|
|
s = _kernel_call(SYS_TIMES, &m);
|
2014-05-22 11:32:14 +02:00
|
|
|
*ticks = m.m_krn_lsys_sys_times.boot_ticks;
|
|
|
|
*realtime = m.m_krn_lsys_sys_times.real_ticks;
|
|
|
|
*boottime = m.m_krn_lsys_sys_times.boot_time;
|
2005-05-31 16:44:49 +02:00
|
|
|
return(s);
|
|
|
|
}
|