Added getuptime2.c
This commit is contained in:
parent
5aa84fb0e6
commit
2519a7cb61
2 changed files with 25 additions and 0 deletions
|
@ -10,6 +10,7 @@ libsysutil_FILES=" \
|
|||
kputc.c \
|
||||
tickdelay.c \
|
||||
getuptime.c \
|
||||
getuptime2.c \
|
||||
env_get_prm.c \
|
||||
env_parse.c \
|
||||
env_panic.c \
|
||||
|
|
24
lib/sysutil/getuptime2.c
Normal file
24
lib/sysutil/getuptime2.c
Normal file
|
@ -0,0 +1,24 @@
|
|||
#include "sysutil.h"
|
||||
|
||||
/*===========================================================================*
|
||||
* getuptime2 *
|
||||
*===========================================================================*/
|
||||
PUBLIC int getuptime2(ticks, boottime)
|
||||
clock_t *ticks; /* uptime in ticks */
|
||||
time_t *boottime;
|
||||
{
|
||||
message m;
|
||||
int s;
|
||||
|
||||
m.m_type = SYS_TIMES; /* request time information */
|
||||
m.T_ENDPT = NONE; /* ignore process times */
|
||||
s = _taskcall(SYSTASK, SYS_TIMES, &m);
|
||||
*ticks = m.T_BOOT_TICKS;
|
||||
*boottime = m.T_BOOTTIME;
|
||||
return(s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in a new issue