bitmap_read(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 to BITS_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: for nbits = 0 and for nbits > 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:


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