kfifo_from_user(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 kfifo_from_user β€” the group-chat recap

okay so this is from the Kernel API Manual, section 9 (the kernel API girlies know πŸ’…), and honestly? it's giving "smuggle data from user space into the fifo" and i'm obsessed.


✨ NAME ✨

kfifo_from_user β€” literally puts some data from user space into the fifo 🫢 no cap, that's the whole job.


πŸŽ€ SYNOPSIS πŸŽ€

kfifo_from_user (fifo , from , len , copied );

like yes bestie it's a macro, yes it takes four things, yes the spacing is iconic, don't touch it πŸ’–


⭐ ARGUMENTS ⭐

  • fifo β€” the address of the fifo you're gonna use. your main character fifo. the one we're filling πŸ’…
  • from β€” pointer to the data to be added. this is where the good stuff comes from ✨
  • len β€” the length of the data to be added. how much we're yeeting in πŸ¦‹
  • copied β€” pointer to an output variable that stores the number of copied bytes. yes, it writes back to you. it's a two-way conversation fr fr 🌸

πŸ”₯ DESCRIPTION πŸ”₯

so this macro copies at most len bytes from from into the fifo, depending on the available space, and returns -EFAULT / 0. that's it, that's the vibe check πŸ‘‘

ok important caveat bestie, listen up 🫢 β€” with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macro. one reader, one writer, no extra locks, periodt. anything more chaotic than that and you're on your own πŸ’€

🌈 SEE ALSO 🌈

Kernel file ./include/linux/kfifo.h β€” and the whole extended kfifo friend group, because nobody does it alone:


πŸŽ€ ok that's the page!! sourced from ./include/linux, dated October 2026, and it's filed under kfifo_from_user(9) in case you need to find it again. mwah, go copy some bytes responsibly bestie πŸ’–βœ¨πŸ§š
πŸ“¦ where this page comes from