mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
![]() 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. |
||
---|---|---|
.. | ||
ACPI | ||
BIOS.cpp | ||
BIOS.h | ||
PowerStateSwitch.cpp | ||
PowerStateSwitch.h | ||
SysFSFirmware.cpp | ||
SysFSFirmware.h |