]> Zhao Yanbai Git Server - minix.git/commitdiff
Added getuptime2.c
authorPhilip Homburg <philip@cs.vu.nl>
Tue, 7 Aug 2007 12:14:04 +0000 (12:14 +0000)
committerPhilip Homburg <philip@cs.vu.nl>
Tue, 7 Aug 2007 12:14:04 +0000 (12:14 +0000)
lib/sysutil/Makefile.in
lib/sysutil/getuptime2.c [new file with mode: 0644]

index 79a6467404f6f166d4852a2187da2d433021ee2c..74717497eaa59ef96644298a1bc6adf1566a75ee 100644 (file)
@@ -10,6 +10,7 @@ libsysutil_FILES=" \
        kputc.c \
        tickdelay.c \
        getuptime.c \
+       getuptime2.c \
        env_get_prm.c \
        env_parse.c \
        env_panic.c \
diff --git a/lib/sysutil/getuptime2.c b/lib/sysutil/getuptime2.c
new file mode 100644 (file)
index 0000000..764f7f7
--- /dev/null
@@ -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);
+}
+
+
+
+
+