kfifo_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– kfifo_get(9) πŸ’–

okay bestie, welcome to the kfifo_get glow-up β€” this is a page from the Kernel API Manual, and honestly? it's a bop. let's get into it 🫢


✨ NAME ✨

kfifo_get β€” get data from the fifo πŸŽ€


✨ SYNOPSIS ✨

kfifo_get (fifo , val );

✨ ARGUMENTS ✨

  • fifo β€” the address of the fifo you wanna use, iykyk 🌸
  • val β€” the address where the data gets stored πŸ‘‘

✨ DESCRIPTION ✨

okay so this macro reads the data from the fifo. simple as that, fr fr.

here's the vibe check on what it hands back:

  • it returns 0 if the fifo was empty 😭 no data, no drama
  • otherwise it returns the number of processed elements πŸ’… slay
⚠️ important bestie note: with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macro. literally no extra locking needed. but the "only one of each" part is doing a LOT of heavy lifting there, so don't come for me if you ignore it πŸ™ˆ

✨ SEE ALSO ✨

Kernel file ./include/linux/kfifo.h, plus the whole friend group 🧚:

DECLARE_KFIFO_PTR(9), DECLARE_KFIFO(9), INIT_KFIFO(9), DEFINE_KFIFO(9), kfifo_initialized(9), kfifo_esize(9), kfifo_recsize(9), kfifo_size(9), kfifo_reset(9), kfifo_reset_out(9), kfifo_len(9), kfifo_is_empty(9), kfifo_is_empty_spinlocked(9), kfifo_is_empty_spinlocked_noirqsave(9), kfifo_is_full(9), kfifo_avail(9), kfifo_skip_count(9), kfifo_skip(9), kfifo_peek_len(9), kfifo_alloc(9), kfifo_alloc_node(9), kfifo_free(9), kfifo_init(9), kfifo_put(9), kfifo_peek(9), kfifo_in(9), kfifo_in_spinlocked(9), kfifo_in_spinlocked_noirqsave(9), kfifo_out(9), kfifo_out_spinlocked(9), kfifo_out_spinlocked_noirqsave(9), kfifo_from_user(9), kfifo_to_user(9), kfifo_dma_in_prepare_mapped(9), kfifo_dma_in_finish(9), kfifo_dma_out_prepare_mapped(9), kfifo_dma_out_finish(9), kfifo_out_peek(9), kfifo_out_linear(9), kfifo_out_linear_ptr(9)


that's the whole page, bestie, go forth and fifo responsibly 🌈

signed, sealed, delivered by ./include/linux Β· October 2026 Β· mwah πŸ’œ
πŸ“¦ where this page comes from