find_nth_and_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– find_nth_and_bit(9) πŸ’–

okay so you opened the Kernel API Manual, and today’s main character is find_nth_and_bit β€” the bit-finding bestie with two memory regions and zero chill. πŸ¦‹βœ¨

🌸 NAME 🌸

find_nth_and_bit β€” find N'th set bit in 2 memory regions

✨ SYNOPSIS ✨

unsigned long find_nth_and_bit (const unsigned long *addr1 , const
       unsigned long *addr2 , unsigned long size , unsigned long n );

πŸŽ€ ARGUMENTS πŸŽ€

here’s the tea on the parameters, bestie:

  • addr1 β€” The 1st address to start the search at. 🫢
  • addr2 β€” The 2nd address to start the search at. πŸ’…
  • size β€” The maximum number of bits to search. that’s the limit, periodt.
  • n β€” The number of set bit, which position is needed, counting from 0. yes bestie, 0 is where the counting starts. πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

Returns the bit number of the N'th set bit. If no such, returns >= size.

that’s it, that’s the vibe: you ask for the N'th set bit, and if there’s no such bit, you get a value >= size. no cap. πŸ’€βœ¨

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/linux/find.h is the spot, and these besties are all linked:


mwah πŸ’‹ β€” signed off from ./include/linux, dated October 2026. slay, bestie πŸŽ€πŸ’œ

πŸ“¦ where this page comes from