devm_regist..._off_handler(9)
π devm_regist..._off_handler(9) π
okay bestie, welcome to the Kernel API Manual β¨ this one's all about devm_register_sys_off_handler β the resource-managed way to sign your device up for the whole "system is going bye-bye" moment. no cap, it's lowkey iconic.
β¨ NAME β¨
devm_register_sys_off_handler β register a sys-off handler π
πΈ SYNOPSIS πΈ
int devm_register_sys_off_handler (struct device *dev , enum
sys_off_mode mode , int priority , int (*callback)(struct sys_off_data
*data) , void *cb_data );
π¦ ARGUMENTS π¦
devβ the device that's registering the handler π«Ά like, this is who's claiming itmodeβ sys-off mode πpriorityβ handler priority, so the important ones go first, obviouslycallbackβ the callback function β this is the main character that actually runscb_dataβ callback argument, the lil bundle of stuff you hand tocallback
π DESCRIPTION π
Registers a resource-managed sys-off handler. the "resource-managed" part is the whole vibe β it's tied to dev and gets cleaned up for you, iykyk π₯
Returns zero on success, or an error code on failure. so like, 0 = slay, anything else = check the code, bestie π
π SEE ALSO π
all from the kernel file ./kernel/reboot.c β go read the whole friend group:
emergency_restart(9)register_reboot_notifier(9)unregister_reboot_notifier(9)register_restart_handler(9)unregister_restart_handler(9)do_kernel_restart(9)kernel_restart(9)kernel_halt(9)register_sys_off_handler(9)unregister_sys_off_handler(9)devm_register_power_off_handler(9)devm_register_restart_handler(9)register_platform_power_off(9)unregister_platform_power_off(9)do_kernel_power_off(9)kernel_can_power_off(9)kernel_power_off(9)orderly_poweroff(9)orderly_reboot(9)hw_failure_emergency_action_func(9)hw_failure_emergency_schedule(9)__hw_protection_trigger(9)
okay that's the whole page, mwah π this one lives in ./kernel, dated October 2026 β same manual name, same date, no notes. periodt. π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms