find_nth_and_andnot_bit(9)
β¨ find_nth_and_andnot_bit(9) β¨
okay bestie, so this is a page from the Kernel API Manual and it's literally about finding bits β like, the N'th set bit, but with a twist π. Not just one memory region, not two, but three, and the third one is a whole exclusion zone. iykyk. Let's get into it π
πΈ NAME πΈ
find_nth_and_andnot_bit β find N'th set bit in 2 memory regions, excluding those set in 3rd region π¦
β SYNOPSIS β
unsigned long find_nth_and_andnot_bit (const unsigned long *addr1 ,
const unsigned long *addr2 , const unsigned long *addr3 , unsigned long
size , unsigned long n );
π ARGUMENTS π
addr1β the 1st address to start the search at. yes, there's a 1st one π«Άaddr2β the 2nd address to start the search at. ok slay, two regions β¨addr3β the 3rd address to start the search at. this one's the hater β anything set here gets excluded πsizeβ the maximum number of bits to search. the vibe check on how far we're willing to look πnβ the number of set bit, which position is needed, counting from 0. yes bestie, counting from 0, that's not a typo π§
π₯ DESCRIPTION π₯
Returns the bit number of the N'th set bit. If no such, returns >= size.
that's it, that's the whole mood π β if it can't find what you asked for it just hands you back something greater than or equal to size so you know the search came up empty. no cap.
π SEE ALSO π
Kernel file ./include/linux/find.h β and the whole bit-finding friend group, fr fr:
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_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)
resident in ./include/linux, and this whole page is dated October 2026 π
and that's the page bestie β go find those bits, but not the ones in the third region, periodt ππ¦β¨
π¦ 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