kfifo_peek(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 kfifo_peek(9) 🌸

okay bestie, welcome to the Kernel API Manual β€” this one's about kfifo_peek(9), and no cap it's a little cutie. let's get into it πŸ’…


✨ NAME ✨

kfifo_peek β€” get data from the fifo without removing it 🫢


πŸ’« SYNOPSIS πŸ’«

kfifo_peek (fifo , val );

πŸŽ€ ARGUMENTS πŸŽ€

  • fifo β€” the address of the fifo you wanna use, bestie. that's the one. πŸ“
  • val β€” the address where the data gets stored. like, that's where it lives now. 🏠

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way this works is: it reads the data from the fifo without removing it from the fifo. peek, don't yeet. look, don't touch. icon behaviour honestly. πŸ‘€βœ¨

it returns 0 if the fifo was empty. otherwise it returns the number of processed elements. so zero = nothing there, bestie, we're empty 😭 and anything else = here's how much we handled πŸ’–

⚠️ important note ok: with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macro. one reader, one writer, that's the vibe check. any more than that and you're on your own fr fr πŸ”₯

🌈 SEE ALSO 🌈

the kernel file ./include/linux/kfifo.h and honestly the whole kfifo girlies, all of them, no skipping:

like, the whole friend group. study them. iykyk πŸ’œ


and that's the page, bestie πŸŽ€ this lil masterpiece came out of ./include/linux and it's dated October 2026 β€” literally iconic, obsessed, periodt πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from