find_random_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’« find_random_bit(9) πŸ’«

okay bestie, welcome to the Kernel API Manual page for find_random_bit(9) β€” yes, the manual name is folded in right here because we're doing this cute and correct. πŸ’– This one is all about finding a set bit at a random position, and honestly? iconic behavior.


πŸ’… NAME πŸ’…

find_random_bit β€” find a set bit at random position.

That's the whole vibe: it finds a set bit, and it picks the position at random. no cap. ✨


πŸŽ€ SYNOPSIS πŸŽ€

       unsigned long find_random_bit (const unsigned long *addr , unsigned long
       size );

🌸 ARGUMENTS 🌸

  • addr β€” The address to base the search on. this is literally the starting point for the search, bestie. 🫢
  • size β€” The bitmap size in bits. yep, it's measured in bits, not bytes β€” keep that energy. πŸ’…

🌈 RETURN 🌈

a position of a random set bit; >= size otherwise.

so you either get a random set bit's position, or you get >= size. that's the return tea. πŸ“


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./lib/find_bit.c β€” go look at the kernel file, iykyk. πŸ‘‘


okay that's the whole page, bestie β€” source/version is ./lib, dated October 2026, and this iconic entry is find_random_bit(9). πŸ’…βœ¨

πŸ“¦ where this page comes from