find_next_or_bit(9)
π NAME π
okay so bestie, welcome to the find_next_or_bit(9) page from the Kernel API Manual π
. We're finding set bits, we're keeping every detail, and we're doing it with main character energy. Let's go β¨
find_next_or_bit β find the next set bit in either memory regions π
β¨ SYNOPSIS β¨
unsigned long find_next_or_bit (const unsigned long *addr1 , const
const unsigned long *addr2 , unsigned long size , unsigned long offset );
That's the signature exactly as written β double const and all, no cap π«Ά.
π ARGUMENTS π
addr1β the first address to base the search on πaddr2β the second address to base the search on πsizeβ the bitmap size in bits πoffsetβ the bitnumber to start searching at π
π₯ DESCRIPTION π₯
okay so the tea β: find_next_or_bit returns the bit number for the next set bit. If no bits are set, it returns size. That's the whole plot β no cap, periodt π
.
So if you're hunting and there's literally nothing set, size is what comes back π«Ά.
π SEE ALSO π
Kernel file: ./include/linux/find.h πΈ β go say hi to the whole find/bit family, they're all iconic:
find_next_bit(9)find_next_and_bit(9)find_next_andnot_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_and_bit_wrap(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)
mwah π β source/version: ./include/linux; date: October 2026; page: find_next_or_bit(9). Bye bestie, go find those bits! πβ¨
π¦ 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