find_nth_and_andnot_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:


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