mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 15:08:21 +00:00
clockget: support CLOCK_MONOTONIC
This commit is contained in:
@@ -5,6 +5,7 @@
|
|||||||
#include <kernel/vmm.h>
|
#include <kernel/vmm.h>
|
||||||
|
|
||||||
#define CLOCK_REALTIME 0
|
#define CLOCK_REALTIME 0
|
||||||
|
#define CLOCK_MONOTONIC 1
|
||||||
#define CLOCK_BOOTTIME 7
|
#define CLOCK_BOOTTIME 7
|
||||||
|
|
||||||
syscallret_t syscall_clockget(context_t *, int clockid, timespec_t *tp) {
|
syscallret_t syscall_clockget(context_t *, int clockid, timespec_t *tp) {
|
||||||
@@ -19,6 +20,7 @@ syscallret_t syscall_clockget(context_t *, int clockid, timespec_t *tp) {
|
|||||||
ret.errno = 0;
|
ret.errno = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CLOCK_MONOTONIC:
|
||||||
case CLOCK_BOOTTIME: {
|
case CLOCK_BOOTTIME: {
|
||||||
timespec_t ts = timekeeper_timefromboot();
|
timespec_t ts = timekeeper_timefromboot();
|
||||||
usercopy_touser(tp, &ts, sizeof(timespec_t));
|
usercopy_touser(tp, &ts, sizeof(timespec_t));
|
||||||
|
|||||||
Reference in New Issue
Block a user