From 8d0dbdeaac4fa1d38ce9b1c467fc3865fb3685e2 Mon Sep 17 00:00:00 2001 From: Liav A Date: Sat, 11 Sep 2021 12:20:47 +0300 Subject: Kernel+Userland: Introduce a new way to reboot and poweroff the machine This change removes the halt and reboot syscalls, and create a new mechanism to change the power state of the machine. Instead of how power state was changed until now, put a SysFS node as writable only for the superuser, that with a defined value, can result in either reboot or poweroff. In the future, a power group can be assigned to this node (which will be the GroupID responsible for power management). This opens an opportunity to permit to shutdown/reboot without superuser permissions, so in the future, a userspace daemon can take control of this node to perform power management operations without superuser permissions, if we enforce different UserID/GroupID on that node. --- Userland/Libraries/LibC/unistd.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'Userland/Libraries/LibC/unistd.h') diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h index 2cdfb4df5c..d738aaa32d 100644 --- a/Userland/Libraries/LibC/unistd.h +++ b/Userland/Libraries/LibC/unistd.h @@ -108,8 +108,6 @@ int chown(const char* pathname, uid_t, gid_t); int fchown(int fd, uid_t, gid_t); int ftruncate(int fd, off_t length); int truncate(const char* path, off_t length); -int halt(); -int reboot(); int mount(int source_fd, const char* target, const char* fs_type, int flags); int umount(const char* mountpoint); int pledge(const char* promises, const char* execpromises); -- cgit v1.2.3