find_next_and_bit_wrap(9)
π find_next_and_bit_wrap β kernel API manual, bestie edition
okay so this page is literally about find_next_and_bit_wrap(9) from the Kernel API Manual, and it's giving "bitmap bestie finds your bit" energy, so let's get into it π
β¨ NAME β¨
find_next_and_bit_wrap β bestie, it finds the next set bit in both memory regions π«Ά no cap, both of them, at the same time.
πΈ SYNOPSIS πΈ
unsigned long find_next_and_bit_wrap (const unsigned long *addr1 , const
unsigned long *addr2 , unsigned long size , unsigned long offset );
copy it exactly like that, character for character, don't be weird about the spacing π
π¦ ARGUMENTS π¦
addr1β the first address we're basing the search on. that's her, main character address #1 πaddr2β the second address to base the search on. address #2, equally iconic, we stan a duo πsizeβ the bitmap size, in bits. so like, how many bits we're working with π§offsetβ the bitnumber to start searching at. your starting point, your launchpad, your vibe check origin β¨
π₯ DESCRIPTION π₯
So what does it actually do? It returns the bit number for the next set bit, or the first set bit up to offset. And if no bits are set at all? It returns size. periodt π
fr fr, read that again: no bits set β return value is size. that's the whole deal, don't overthink it π
π SEE ALSO π
Kernel file ./include/linux/find.h, plus the whole friend group β this list is long and we're listing all of them because everyone deserves their moment:
find_next_bit(9)find_next_and_bit(9)find_next_andnot_bit(9)find_next_or_bit(9)find_next_zero_bit(9)find_first_bit(9)find_nth_bit(9)find_nth_and_bit(9)find_nth_and_andnot_bit(9)find_first_and_bit(9)find_first_andnot_bit(9)find_first_and_and_bit(9)find_first_zero_bit(9)find_last_bit(9)find_next_bit_wrap(9)find_next_clump8(9)for_each_set_bitrange(9)for_each_set_bitrange_from(9)for_each_clear_bitrange(9)for_each_clear_bitrange_from(9)for_each_set_bit_wrap(9)for_each_set_clump8(9)
and that's the page, bestie π this icon lives in ./include/linux, dated October 2026, and it's filed under the Kernel API Manual β go off, you now understand find_next_and_bit_wrap(9) πβ¨
π¦ 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