find_first_andnot_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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:


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