bitmap_read(9)
π bitmap_read(9) β the kernel API manual, but make it cute π
okay so bestie, welcome to bitmap_read(9), a page from the big official Kernel API Manual and honestly? it's a little icon. tiny function, huge main character energy. it reads a value of n-bits out of a memory region and hands it to you like a lil gift π
β¨ NAME β¨
bitmap_read β read a value of n-bits from the memory region. that's it, that's the whole vibe. no cap. π
πΈ SYNOPSIS πΈ
unsigned long bitmap_read (const unsigned long *map , unsigned long
start , unsigned long nbits );
look at her. one line-ish of pure C, returning an unsigned long. she slays, she reads bits, she leaves. π₯
π¦ ARGUMENTS π¦
mapβ the address to the bitmap memory region, aka where the bits actually live. this is the destination of your little field trip πΊοΈstartβ the bit offset of the n-bit value. so like, where you're starting from, bestie. not byte offset, bit offset, iykyk πnbitsβ the size of the value in bits. must be nonzero, and it goes up toBITS_PER_LONGβ that's the ceiling, don't push it π
π RETURN π
you get back the value of nbits bits that live at the start bit offset inside the map memory region. literally exactly what you asked for, no notes π
okay but the important part, and I need you to actually read this one: fornbits = 0and fornbits > BITS_PER_LONG, the return value is undefined. undefined, bestie. not zero, not a fun surprise β undefined. do not pass go, do not collect your bits π
π SEE ALSO π
the whole extended friend group, fr fr:
- Kernel file
./include/linux/bitmap.h bitmap overview(9)bitmap bitops(9)declare bitmap(9)bitmap_find_next_zero_area(9)bitmap_or_equal(9)bitmap_weight_from(9)bitmap_scatter(9)bitmap_gather(9)bitmap_release_region(9)bitmap_allocate_region(9)bitmap_find_free_region(9)BITMAP_FROM_U64(9)bitmap_from_u64(9)bitmap_write(9)β yes, the other one. the writer. her sibling π
that's the whole page, you ate that π«Ά this cutie lives over in ./include/linux, dated October 2026, and she's filed under bitmap_read(9) β go forth and read some bits, queen πβ¨
π¦ 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