From 14fd2aecd074fb93bb509df0c1cedd1f1055a4a6 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Mon, 18 Sep 2023 16:20:52 +0200 Subject: kernel: implement _sys_time() After some consideration this seems like the most fitting way to handle timekeeping. Directly, the syscall is only useful for keeping time within a single process, but it is meant to be used for e.g. NTP clients, which will provide the real time through the VFS. --- src/libk/include/camellia/syscalls.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libk') diff --git a/src/libk/include/camellia/syscalls.h b/src/libk/include/camellia/syscalls.h index 58898d4..d27ae0c 100644 --- a/src/libk/include/camellia/syscalls.h +++ b/src/libk/include/camellia/syscalls.h @@ -22,6 +22,7 @@ #define _SYS_GETPPID 20 #define _SYS_WAIT2 21 #define _SYS_GETPROCFS 22 +#define _SYS_TIME 23 #define _SYS_EXECBUF 100 #define _SYS_DEBUG_KLOG 101 @@ -84,6 +85,9 @@ int _sys_wait2(int pid, int flags, struct sys_wait2 __user *out); hid_t _sys_getprocfs(int flags); +/** Returns the time in nanoseconds since the first _sys_time call in the process */ +uint64_t _sys_time(int flags); + /* see shared/execbuf.h */ long _sys_execbuf(void __user *buf, size_t len); -- cgit v1.2.3