From 326cedcca7050ec0b143ff3d2ad94839f77ab22e Mon Sep 17 00:00:00 2001 From: Anton Kling Date: Mon, 1 Jul 2024 16:21:43 +0200 Subject: LibC: Change how kill() works --- userland/libc/time/clock_gettime.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'userland/libc/time') diff --git a/userland/libc/time/clock_gettime.c b/userland/libc/time/clock_gettime.c index 492b968..239b389 100644 --- a/userland/libc/time/clock_gettime.c +++ b/userland/libc/time/clock_gettime.c @@ -1,15 +1,12 @@ +#include +#include #include #include +#include int clock_gettime(clockid_t clock_id, struct timespec *tp) { - (void)clock_id; - tp->tv_sec = 0; - tp->tv_nsec = 0; - return 0; - /* -SYS_CLOCK_GETTIME_PARAMS args = { -.clk = clock_id, -.ts = tp, -}; -return syscall(SYS_CLOCK_GETTIME, &args);*/ + uint32_t ms = uptime(); + tp->tv_sec = ms / 1000; + tp->tv_nsec = ms * 1000000; + RC_ERRNO(syscall(SYS_CLOCK_GETTIME, clock_id, tp, 0, 0, 0)); } -- cgit v1.2.3