register_platform_power_off(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Welcome to the Kernel API Manual, bestie πŸ’– β€” this is the page for register_platform_power_off(9), and it is literally all about handing the kernel your platform-level power-off callback. no cap.

🌸 NAME 🌸

register_platform_power_off β€” Register platform-level power-off callback. It’s giving β€œlast-resort shutdown behavior,” and honestly? iconic. πŸ’…

✨ SYNOPSIS ✨

int register_platform_power_off (void (*power_off)(void) );

πŸŽ€ ARGUMENTS πŸŽ€

  • power_off β€” Power-off callback. This is the callback that gets registered for power-off duty, and its signature is right there in the synopsis: void (*power_off)(void). 🫢

πŸ’… DESCRIPTION πŸ’…

Okay so here’s the tea: this registers a power_off callback that will be called as the last step of the power-off sequence, bestie. This callback is expected to be invoked for the last resort β€” like the final-final-final backup plan. No pressure or anything. 😭πŸ”₯

Only one platform power-off callback is allowed to be registered at a time. One callback. That’s the whole roster. So don’t be out here trying to register a second one like it’s a group chat; the API said what it said. πŸ’€

Return behavior: it returns 0 on success, or an error code on failure. If you get 0, slay ✨. If you get an error code, read it and handle your business, fr fr. 🫑

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file: ./kernel/reboot.c β€” and the whole friend group is here:


mwah πŸ’‹ β€” with love from the ./kernel source, October 2026 edition, aka the register_platform_power_off(9) page. 🫢✨

πŸ“¦ where this page comes from