fls(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, welcome to fls(9) from the Kernel API Manual β€” this is the bit-hunting page and it's lowkey iconic πŸŽ€βœ¨

🌸 NAME 🌸

fls β€” find the last (most-significant) bit set. that's the whole vibe: last bit, most-significant, set. periodt πŸ’…

✨ SYNOPSIS ✨

int fls (unsigned int x );

yup, that's the signature, don't @ me 🫢

πŸŽ€ ARGUMENTS πŸŽ€

  • x β€” the word to search. literally the word you're sending in to get searched πŸ”πŸ’–

πŸ’– DESCRIPTION πŸ’–

okay so this is defined the same way as ffs β€” no cap, same definition energy.

and here's the note you need to keep in your group chat: fls(0) = 0, fls(1) = 1, and fls(0x80000000) = 32 ⭐. write those down, bestie, they're giving exam-question main character energy 😭

πŸ¦‹ SEE ALSO πŸ¦‹

  • Kernel file ./include/asm-generic/bitops/builtin-fls.h β€” go read it if you want the source tea πŸ΅πŸ’œ

sign-off time: source/version ./include/asm-generic/bitops, dated October 2026, manual fls(9) β€” mwah, go slay those bits πŸ’‹βœ¨

πŸ“¦ where this page comes from