DOPOWERHOOKS(9)
π 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: thedopowerhooksroutine is deprecated. like, officially. usepmf_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 π
powerhook_establish(9)β the one who actually sets up the hooks she runs, iykyk π«Ά
β 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
- nixpkgs unstable: netbsd-source 11.0
- Copyright (c) 1999 The NetBSD Foundation, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms