apple_smc_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 the struct apple_smc. this is the main character, the thing we're reading from πŸ’…
  • key β€” the smc_key you wanna read. pick your key, bestie πŸ—οΈ
  • buf β€” the buffer that size bytes of data get read into from the SMC. your lil container πŸ“
  • size β€” the number of bytes to be read into buf. 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