find_next_or_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay so bestie, welcome to the find_next_or_bit(9) page from the Kernel API Manual πŸ’…. We're finding set bits, we're keeping every detail, and we're doing it with main character energy. Let's go ✨

find_next_or_bit β€” find the next set bit in either memory regions πŸ’…


✨ SYNOPSIS ✨

unsigned long find_next_or_bit (const unsigned long *addr1 , const
       const unsigned long *addr2 , unsigned long size , unsigned long offset );

That's the signature exactly as written β€” double const and all, no cap 🫢.


πŸ’– ARGUMENTS πŸ’–

  • addr1 β€” the first address to base the search on πŸ”
  • addr2 β€” the second address to base the search on πŸ”
  • size β€” the bitmap size in bits πŸ“
  • offset β€” the bitnumber to start searching at πŸ‘€

πŸ”₯ DESCRIPTION πŸ”₯

okay so the tea β˜•: find_next_or_bit returns the bit number for the next set bit. If no bits are set, it returns size. That's the whole plot β€” no cap, periodt πŸ’….

So if you're hunting and there's literally nothing set, size is what comes back 🫢.


🌈 SEE ALSO 🌈

Kernel file: ./include/linux/find.h πŸ›Έ β€” go say hi to the whole find/bit family, they're all iconic:


mwah πŸ’‹ β€” source/version: ./include/linux; date: October 2026; page: find_next_or_bit(9). Bye bestie, go find those bits! πŸŽ€βœ¨

πŸ“¦ where this page comes from