sysfs_emit_at(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ sysfs_emit_at(9) ✨

okay so bestie, welcome to the Kernel API Manual entry for sysfs_emit_at β€” yes it's a kernel function, yes it's a 9-section manpage, and yes we're gonna get through it together πŸ’…


🌸 NAME 🌸

sysfs_emit_at β€” literally the scnprintf equivalent, except it knows about the PAGE_SIZE buffer. no cap. it's giving "snprintf but self-aware" πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int sysfs_emit_at (char *buf , int at , const char *fmt , ... );

that's the whole signature, bestie. int in, int out, and a little ... at the end doing its mysterious variadic thing ✨


πŸ’– ARGUMENTS πŸ’–

  • buf β€” start of the PAGE_SIZE buffer. this is where the magic lives 🫢
  • at β€” offset in buf to start writing, in bytes. and it must satisfy at must be >= 0 && < PAGE_SIZE β€” like, this is not a suggestion, it's a vibe check you cannot fail 😭
  • fmt β€” the format. your classic format string, you know her πŸ‘‘
  • ... β€” optional arguments to fmt. the little squad that tags along 🧚

🌈 DESCRIPTION 🌈

Returns the number of characters written, starting at &buf[at]. that's it, that's the whole description, and honestly? iconic. short, sweet, to the point πŸ’œ

lowkey the key detail here is that at is an offset, so you're not writing at the beginning of the buffer, you're writing at &buf[at] β€” and the count you get back is the chars written from that point πŸ”₯

⭐ SEE ALSO ⭐

the whole friend group, in the kernel file ./fs/sysfs/file.c:

like, that's the entire sysfs cinematic universe, and you're gonna wanna know all of them eventually πŸ’€πŸ’–


πŸ’… friendly reminder that ./fs/sysfs is the kernel file path that goes with this page, so if you ever need to go read the source, that's the door, bestie, go knock πŸšͺ✨

and that's the page!! from ./fs/sysfs, October 2026 edition β€” go forth and emit responsibly, mwah πŸŽ€πŸ’œπŸ¦‹

πŸ“¦ where this page comes from