generic___ffs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ NAME πŸŽ€

okay bestie, meet generic___ffs from the Kernel API Manual β€” it's the little icon whose whole job is to find the first bit in a word. πŸ’…βœ¨


🌸 SYNOPSIS 🌸

unsigned int generic___ffs (unsigned long word );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • word β€” the word to search, bestie. literally the thing you're searching through. πŸ”πŸ’–

πŸ’œ DESCRIPTION πŸ’œ

So like… it finds the first bit in a word. that's the vibe. 🫢

🚨 Undefined behavior alert: it's undefined if no bit exists, so your code should check against 0 first. no cap, do the check. πŸ˜­πŸ’€

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./include/asm-generic/bitops/__ffs.h β€” go read it, iykyk πŸ“–βœ¨

mwah πŸ’‹ this iconic little page is from the Kernel API Manual, source/version ./include/asm-generic/bitops, dated October 2026, and you've been reading generic___ffs(9). periodt. πŸ‘‘πŸŒˆ

πŸ“¦ where this page comes from