find_first_and_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… find_first_and_bit(9) πŸ’…

okay bestie, welcome to the Kernel API Manual page for find_first_and_bit(9) β€” yes, the manual name is literally right there, folded in like a cute lil intro. This function is lowkey iconic: it’s here to find the first set bit in both memory regions. No cap. ✨

✨ NAME ✨

find_first_and_bit β€” find the first set bit in both memory regions. It’s giving β€œsearch both regions” energy, and honestly? Obsessed. πŸ¦‹

🌸 SYNOPSIS 🌸

unsigned long find_first_and_bit (const unsigned long *addr1 , const unsigned long *addr2 , unsigned long size );

πŸŽ€ ARGUMENTS πŸŽ€

  • addr1 β€” the first address to base the search on. Like, the first spot you’re checking, bestie. πŸ‘‘
  • addr2 β€” the second address to base the search on. The other spot in the duo. πŸ’…
  • size β€” the bitmap size in bits. That’s how many bits are in the bitmap, periodt. πŸ”₯

πŸ”₯ DESCRIPTION πŸ”₯

It returns the bit number for the next set bit. If no bits are set, it returns size. That’s it β€” no extra plot twists, no secret side quests. 🌈

okay so if you were hoping for a dramatic ending where it returns something else when nothing is set: nope, it returns size. That’s the rule, and it ate. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

The kernel file is ./tools/include/linux/find.h β€” that’s where the related lore lives. The whole friend group:


xoxo, your Kernel API Manual bestie πŸ’– β€” sourced from ./tools/include/linux, dated October 2026, and this page is find_first_and_bit(9). periodt. 🫢

πŸ“¦ where this page comes from