diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-01 16:42:55 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-06-01 16:42:55 +0300 |
| commit | 7a1c7ed1b1c30ba4c668194a955fb414e471bade (patch) | |
| tree | 2f49f04e455f004af640918abfcd6f91ce6a1323 /src/uapi/conf.c | |
| parent | e8f80bae97a835b6b256228d4bbeaf48ae16dcbb (diff) | |
| download | kmi-7a1c7ed1b1c30ba4c668194a955fb414e471bade.tar.gz kmi-7a1c7ed1b1c30ba4c668194a955fb414e471bade.zip | |
add sleep syscall
+ Sets the current core to sleep
Diffstat (limited to 'src/uapi/conf.c')
| -rw-r--r-- | src/uapi/conf.c | 10 |
1 files changed, 9 insertions, 1 deletions
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()); +} |
