find_random_bit(9)
π« 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms