DECLARE_KFIFO(9)
β¨ DECLARE_KFIFO β¨
okay so bestie, welcome to the Kernel API Manual π this one's a little macro that literally just declares a fifo object for you, no cap. Think of it as the birth certificate of your fifo π
πΈ NAME πΈ
DECLARE_KFIFO β macro to declare a fifo object π
π¦ SYNOPSIS π¦
DECLARE_KFIFO (fifo , type , size );
π ARGUMENTS π
fifoβ the name of the declared fifo. this is what you're gonna call your baby π pick something cute, or y'know, something descriptive, we don't judge.typeβ the type of the fifo elements. like, what are you actually storing in here?? that's this. β¨sizeβ the number of elements in the fifo. and this must be a power of 2 π no exceptions, non-negotiable, do not come at me with your 3 or your 100, it's giving undefined behaviour energy and we don't do that here π
not me emphasizing this again β size has to be a power of 2, fr fr. that's the whole vibe check for this argument. π₯
π SEE ALSO π
- the kernel file
./include/linux/kfifo.hβ go read it, it's iconic π§ DECLARE_KFIFO_PTR(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_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 a lot of siblings but they all slay in their own way, go check 'em out π«Ά
mwah π that's the page! this one lives in ./include/linux in the Kernel API Manual, and it was dated October 2026 β so like, technically from the future, main character energy fr β bye bestie, go declare some fifos β¨
π¦ 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