find_first_andnot_bit(9)
π find_first_andnot_bit(9) π
okay bestie, welcome to the Kernel API Manual β today's main character is literally find_first_andnot_bit(9). It's giving "find me a bit that's set in one bitmap and unset in the other" energy. π¦
πΈ NAME πΈ
find_first_andnot_bit β find the first bit set in 1st memory region and unset in 2nd.
β¨ SYNOPSIS β¨
Here's the exact signature, no cap:
unsigned long find_first_andnot_bit (const unsigned long *addr1 , const unsigned long *addr2 , unsigned long size );
π ARGUMENTS π
addr1β the first address to base the search on. Like, search headquarters #1. πaddr2β the second address to base the search on. Search headquarters #2, bestie.sizeβ the bitmap size in bits. Yep, bits, periodt. π«Ά
π DESCRIPTION π
It returns the bit number for the first set bit, iykyk. And if no bits are set, it returns >= size. That's the whole vibe check: first set bit in the first memory region that's unset in the second, or a value >= size when there's nothing to find. πβ¨
π SEE ALSO π
Kernel file ./include/linux/find.h is the spot to peek at, and these cuties are all linked from the same crew:
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_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)
Cute sign-off time: this page's source/version spot is ./include/linux, it's dated October 2026, and it's literally the find_first_andnot_bit(9) manual page. 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