From 7a1c7ed1b1c30ba4c668194a955fb414e471bade Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sat, 1 Jun 2024 16:42:55 +0300 Subject: add sleep syscall + Sets the current core to sleep --- src/uapi/conf.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/uapi/conf.c') diff --git a/src/uapi/conf.c b/src/uapi/conf.c index 894b98a..497aef0 100644 --- a/src/uapi/conf.c +++ b/src/uapi/conf.c @@ -108,8 +108,16 @@ SYSCALL_DEFINE1(poweroff)(struct tcb *t, sys_arg_t type) case SHUTDOWN: case COLD_REBOOT: case WARM_REBOOT: - return_args2(t, OK, poweroff(type)); + return_args1(t, poweroff(type)); }; return_args1(t, ERR_INVAL); } + +SYSCALL_DEFINE0(sleep)(struct tcb *t) +{ + if (!(has_cap(t->caps, CAP_POWER))) + return_args1(t, ERR_PERM); + + return_args1(t, sleep()); +} -- cgit v1.3