sysfs_emit_at(9)
β¨ 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 thePAGE_SIZEbuffer. this is where the magic lives π«Άatβ offset inbufto start writing, in bytes. and it must satisfyat 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 tofmt. 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 thatatis 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:
sysfs_create_file_ns(9)sysfs_add_file_to_group(9)sysfs_chmod_file(9)sysfs_break_active_protection(9)sysfs_unbreak_active_protection(9)sysfs_remove_file_ns(9)sysfs_remove_file_self(9)sysfs_remove_file_from_group(9)sysfs_create_bin_file(9)sysfs_remove_bin_file(9)sysfs_link_change_owner(9)sysfs_file_change_owner(9)sysfs_change_owner(9)sysfs_emit(9)sysfs_bin_attr_simple_read(9)
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
- 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