kfifo_to_user(9)
π kfifo_to_user β kernel API manual, but make it cute β¨
okay so bestie, you found the kfifo_to_user(9) page in the Kernel API Manual and honestly? it's a tiny little macro that does one job and does it slayfully. let's get into it π
πΈ NAME πΈ
kfifo_to_user β copies data from the fifo into user space π
like literally, that's the whole personality. fifo data goes out into user space. periodt.
β¨ SYNOPSIS β¨
kfifo_to_user (fifo , to , len , copied );
four args, no drama. write them out exactly like that, spaces and all, she's particular π
π«Ά ARGUMENTS π«Ά
fifoβ address of the fifo to be used. this is your little fifo bestie, hand her over.toβ where the data must be copied. destination buffer energy β¨lenβ the size of the destination buffer. don't overshoot, that's not the vibe.copiedβ pointer to output variable to store the number of copied bytes. she reports back how much actually made it, iykyk π₯
π¦ DESCRIPTION π¦
so this macro copies at most len bytes from the fifo into the to buffer, and returns -EFAULT/0. that's it. that's the whole function. iconic behaviour, no notes π
β οΈ and here's the caveat bestie, do not skip this: with only one concurrent reader and one concurrent writer, you don't need extra locking to use these macro. only one reader and one writer though β the second that math changes, you're on your own π
π SEE ALSO π
kernel file ./include/linux/kfifo.h, plus the whole entire kfifo 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_get(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_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 every single one, i counted, main character energy across the whole header file fr fr π
and that's the page babes π§ from ./include/linux, dated October 2026, signed kfifo_to_user(9) β mwah, study it, love you, bye ππ
π¦ 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