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/kernel/proc.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/kernel/proc.h') diff --git a/src/kernel/proc.h b/src/kernel/proc.h index bfe5cfc..5d95b52 100644 --- a/src/kernel/proc.h +++ b/src/kernel/proc.h @@ -98,6 +98,9 @@ struct Proc { size_t len; size_t pos; } execbuf; + + /* Time of the first _sys_time() call. 0 if not called yet. */ + uint64_t basetime; }; extern Proc *proc_cur; -- cgit v1.2.3