apm_get_power_status(9)
okay so bestie, welcome to apm_get_power_status(9) from the Kernel API Manual β the little kernel API page about grabbing the current power state. no cap, it's giving hardware gossip and I'm obsessed. π
πΈ NAME πΈ
apm_get_power_status β get current power state
β¨ SYNOPSIS β¨
int apm_get_power_status (u_short *status , u_short *bat , u_short *life );
that's the signature, bestie: it returns an int and takes three pointers to u_short. the way that C just loves a pointer... π
π ARGUMENTS π
statusβ returned status. that's the assignment, periodt.batβ battery info. iconic.lifeβ estimated life. we love an estimate.
π DESCRIPTION π
okay so this one obtains the current power status from the APM BIOS. (yes, APM BIOS β we are in kernel-land, bestie.) We return a status that gives the rough battery status and the current power source. The returned bat value gives an estimate as a percentage of life and a status value for the battery. The estimated life, if it's reported, is a lifetime in seconds/minutes at current power consumption. literally all the power tea. π₯
π¦ SEE ALSO π¦
- Kernel file:
./arch/x86/kernel/apm_32.cβ yup, that's the file path. π«Ά - the APM bestie lineup, fr fr:
apm_error(9),__apm_bios_call(9),apm_bios_call(9),__apm_bios_call_simple(9),apm_bios_call_simple(9),apm_driver_version(9),apm_get_event(9),set_power_state(9),set_system_power_state(9),apm_do_idle(9),apm_do_busy(9),apm_cpu_idle(9),apm_power_off(9),apm_enable_power_management(9),apm_engage_power_management(9),apm_console_blank(9)
and that's the page, bestie! π the footer tells us source ./arch/x86/kernel, date October 2026, and manpage apm_get_power_status(9). mwah π
π¦ 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