ladybird/Kernel/Firmware
Liav A f8489da8ee Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes
Normally, trying to truncate a SysFSInode should result in EPERM error.
However, as suggested by Ali (@alimpfard), we can allow the PowerState
node to be "truncated" so one can open that file with O_TRUNC option.
Likewise, we also need to provide a way to set modified time on SysFS
inodes. For most inodes, we should return ENOTIMPL error, but for the
power state switch, we ignore the modified time setting and just return
KSuccess.

These fixes allow to do "echo -n 1 > /sys/firmware/power_state" in Shell
after gaining root permissions, to switch the power state.
2021-10-09 12:07:56 +02:00
..
ACPI Kernel: Use operator ""sv in all purpose() implementations 2021-10-03 13:36:10 +02:00
BIOS.cpp Kernel: Unify BIOS and ACPI components in the SysFS firmware directory 2021-09-12 11:52:16 +02:00
BIOS.h Kernel: Unify BIOS and ACPI components in the SysFS firmware directory 2021-09-12 11:52:16 +02:00
PowerStateSwitch.cpp Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes 2021-10-09 12:07:56 +02:00
PowerStateSwitch.h Kernel/SysFS: Provide a way to "truncate" and "set" mtime on inodes 2021-10-09 12:07:56 +02:00
SysFSFirmware.cpp Kernel+Userland: Introduce a new way to reboot and poweroff the machine 2021-09-12 11:52:16 +02:00
SysFSFirmware.h Kernel: Unify BIOS and ACPI components in the SysFS firmware directory 2021-09-12 11:52:16 +02:00