Remove building with NOCRYPTO option
[minix.git] / minix / lib / libsys / getuptime.c
blob298c787fcd0856fabfcc08cd0365b85ce728bb5c
1 #include "sysutil.h"
3 /*
4 * Retrieve the system's uptime (number of clock ticks since system boot),
5 * real time (corrected number of clock ticks since system boot), and
6 * boot time (in number of seconds since the UNIX epoch).
7 */
8 int
9 getuptime(clock_t * uptime, clock_t * realtime, time_t * boottime)
11 struct minix_kerninfo *minix_kerninfo;
13 minix_kerninfo = get_minix_kerninfo();
15 /* We assume atomic 32-bit field retrieval. TODO: 64-bit support. */
16 if (uptime != NULL)
17 *uptime = minix_kerninfo->kclockinfo->uptime;
18 if (realtime != NULL)
19 *realtime = minix_kerninfo->kclockinfo->realtime;
20 if (boottime != NULL)
21 *boottime = minix_kerninfo->kclockinfo->boottime;
23 return OK;