find_first_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… find_first_bit

okay so bestie, welcome to the Kernel API Manual ✨ β€” yes you're literally reading kernel API docs now, main character energy fr fr πŸŽ€


🌸 NAME 🌸

find_first_bit β€” find the first set bit in a memory region πŸ’–


✨ SYNOPSIS ✨

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

that's the whole signature, no cap 🫢


🧚 ARGUMENTS 🧚

  • addr β€” The address to start the search at πŸ‘€ like, where the hunt begins
  • size β€” The maximum number of bits to search πŸŽ€ the search budget, basically

🌈 DESCRIPTION 🌈

Returns the bit number of the first set bit. ⭐

And if no bits are set? it just returns size. yep, that's it, that's the whole vibe check πŸ’€ no drama, no -1, just size. iconic behavior honestly.


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./tools/include/linux/find.h πŸ‘‘

all the bit-finding besties, go read them too πŸ’œ


ngl bestie, this one's short and sweet β€” but the details are the details, so memorize them πŸ˜­πŸ’–

✨ k bye, this page was brought to you by ./tools/include/linux, dated October 2026, and it's literally named find_first_bit(9) β€” slay, go find those bits ✨ πŸ“πŸ§šβ€β™€οΈπŸ‘‘πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from