apple_smc_read(9)
π apple_smc_read β the kernel API manual, bestie edition π
okay so this is apple_smc_read(9) from the Kernel API Manual, and it's literally the function that goes "hey SMC, gimme size bytes of that key, thanks bestie" and drops them into your buffer. slay. let's get into it π«Ά
β¨ NAME β¨
apple_smc_read β read size bytes from the given SMC key into buf. that's it, that's the whole vibe. π
πΈ SYNOPSIS πΈ
int apple_smc_read (struct apple_smc *smc , smc_key key , void *buf ,
size_t size );
π ARGUMENTS π
smcβ pointer to thestruct apple_smc. this is the main character, the thing we're reading from πkeyβ thesmc_keyyou wanna read. pick your key, bestie ποΈbufβ the buffer thatsizebytes of data get read into from the SMC. your lil container πsizeβ the number of bytes to be read intobuf. tell it exactly how much you want, no cap β¨
β RETURN β
zero on success, negative errno on error. so like β 0 is the slay outcome, and if it goes negative that's the kernel telling you "not today" π
π¦ SEE ALSO π¦
the kernel file ./include/linux/mfd/macsmc.h, plus the whole friend group: smc_key(9), SMC_KEY(9), struct apple_smc_key_info(9), enum apple_smc_boot_stage(9), struct apple_smc(9), apple_smc_write(9), apple_smc_enter_atomic(9), apple_smc_write_atomic(9), apple_smc_rw(9), apple_smc_get_key_by_index(9), apple_smc_get_key_info(9), apple_smc_key_exists(9) β go read those too, iykyk π
anyway that's the whole page, mwah π β this one lives over in ./include/linux/mfd, dated October 2026, and yes it's still called apple_smc_read(9) in case you forgot already. ily, go read some SMC keys π§ββοΈ
π¦ 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