DOPOWERHOOKS(9)

πŸ“¦ version 11.0, in nixpkgs unstable

πŸ’… DOPOWERHOOKS πŸ’…

okay so bestie, welcome to DOPOWERHOOKS(9) β€” that's section 9 of the Kernel Developer's Manual, aka the deep-magic zone where the kernel girlies hang out. this one's a little vintage, a little deprecated, but she still ate and we're gonna learn her. πŸŽ€


✨ NAME ✨

dopowerhooks β€” run all power hooks, like, all of them, no cap πŸ”₯


πŸ¦‹ SYNOPSIS πŸ¦‹

void
dopowerhooks(int why);

that's it. one function, one int, zero drama. she's simple. she's iconic. she's... deprecated (more on that in a sec, don't panic 😭).


🌸 DESCRIPTION 🌸

⚠️ BIG WARNING FIRST, BESTIE: the dopowerhooks routine is deprecated. like, officially. use pmf_system_suspend(9) instead. we love an upgrade arc πŸ’…βœ¨

okay so what does she actually do? the dopowerhooks() function invokes all power hooks established using the powerhook_establish(9) function. every single one. she's a social butterfly, she's inviting the whole group chat.

here's the tea on the ordering, and it's giving chaotic-but-makes-sense:

  • when power is disappearing, the power hooks are called in reverse order β€” i.e., the power hook established last will be called first. last in, first out, main character energy πŸ‘‘
  • when power is restored, they are called in normal order. back to business as usual, slay 🌈

and where does she get called from? this function is called from the apm(4) driver when a power change is detected. so like, if your machine notices the power situation shifting, apm(4) picks up the phone and rings dopowerhooks(). πŸ“žβœ¨


πŸ‘€ SEE ALSO πŸ‘€


⭐ sign-off ⭐

this lil page comes to you from Debian, dated February 11, 2010 β€” yeah she's a throwback, a vintage queen, and her manual page name is DOPOWERHOOKS(9) in case you forgot already πŸ’–. go forth and use pmf_system_suspend(9) bestie, ily, bye! πŸ§šπŸ’œ

πŸ“¦ where this page comes from