Kernel/LibC: add clock_gettime() for CLOCK_MONOTONIC

This gets the number of milliseconds since boot
This commit is contained in:
2023-07-06 00:38:29 +03:00
parent 86df258365
commit 3c068aa0ae
7 changed files with 40 additions and 0 deletions

View File

@@ -244,6 +244,13 @@ long syscall(long syscall, ...)
ret = Kernel::syscall(SYS_SET_PWD, (uintptr_t)path);
break;
}
case SYS_CLOCK_GETTIME:
{
clockid_t clock_id = va_arg(args, clockid_t);
timespec* tp = va_arg(args, timespec*);
ret = Kernel::syscall(SYS_CLOCK_GETTIME, clock_id, (uintptr_t)tp);
break;
}
default:
puts("LibC: Unhandeled syscall");
ret = -ENOSYS;