generic___fls(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ NAME πŸ¦‹

okay bestie, meet generic___fls(9) from the Kernel API Manual πŸ’– β€” it finds the last (most-significant) set bit in a long word. iconic little bit-hunter behavior, ngl.

✨ SYNOPSIS ✨

unsigned int generic___fls (unsigned long word );

lowkey that's the whole signature. no cap.

🌸 ARGUMENTS 🌸

  • word β€” the word to search. that's the long word you're handing over for the vibe check πŸ”

πŸ’… DESCRIPTION πŸ’…

so bestie, this is undefined if no set bit exists 😭 β€” like, no set bit at all means we're in undefined-behavior territory. so your code should check against 0 first, fr fr. that's the whole safety memo.

πŸŽ€ SEE ALSO πŸŽ€

  • Kernel file ./tools/include/asm-generic/bitops/__fls.h β€” go read the source, bestie, it's giving lore πŸ‘€

mwah πŸ’– β€” signing off with the footer tea: Kernel API Manual source/version vibes from ./tools/include/asm-generic/bi..., dated October 2026, with generic___fls(9) on the right, living its best life. 🫢✨

πŸ“¦ where this page comes from