diff options
author | dzwdz | 2023-09-18 16:20:52 +0200 |
---|---|---|
committer | dzwdz | 2023-09-18 16:20:52 +0200 |
commit | 14fd2aecd074fb93bb509df0c1cedd1f1055a4a6 (patch) | |
tree | 10ecb45967748a6b65558074f22c8cdf52ee74ae /src/libk | |
parent | 730a929fffbaaaeb20529962654049fe26dd5dde (diff) |
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.
Diffstat (limited to 'src/libk')
-rw-r--r-- | src/libk/include/camellia/syscalls.h | 4 |
1 files changed, 4 insertions, 0 deletions
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); |