kfifo_in(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kfifo_in β€” like, the Kernel API Manual page, but make it make sense πŸ’–

okay so bestie, this is kfifo_in(9) from the Kernel API Manual β€” yes, the kernel, the big one, the main character of your whole operating system πŸ§πŸ‘‘. It's a macro. It's small. It's iconic. Let's get into it ✨


✨ NAME ✨

kfifo_in β€” put data into the fifo πŸ’Œ

like literally just yeet your data into the fifo. that's the whole job. slay.


πŸŽ€ SYNOPSIS πŸŽ€

kfifo_in (fifo , buf , n );

that's it. three things in, magic out. no cap 🫢


🌸 ARGUMENTS 🌸

  • fifo β€” the address of the fifo you're gonna use πŸ’… like, hand me the fifo please, thank you.
  • buf β€” the data you want to add. this is the actual stuff going in πŸ“¦βœ¨
  • n β€” how many elements you're adding. the count. the amount. the number of little guys 🧚

πŸ¦‹ DESCRIPTION πŸ¦‹

so this macro copies the given buffer into the fifo and returns the number of copied elements πŸ’– yes, it returns a count β€” it's giving "here's how much actually made it in", which is highkey useful, iykyk.

⚠️ okay important caveat bestie, listen: with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macro. that's it. that's the deal. don't add locks you don't need, but also don't get cute and add more readers/writers than that and expect it to just work 😭

literally the whole vibe: one reader, one writer, no locking, we're chilling 🌈


πŸ”₯ SEE ALSO πŸ”₯

like, that's the whole kfifo friend group and they're ALL invited to the group chat πŸ«ΆπŸ’œ


πŸ’Œ cute sign-off πŸ’Œ

this page lives in ./include/linux, dated October 2026, and it's page kfifo_in(9) of the Kernel API Manual. mwah. go forth and fifo responsibly πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from