__ffs64(9)
π __ffs64 π
okay so bestie, welcome to the Kernel API Manual page for __ffs64 π
she finds the first set bit in a 64 bit word, and honestly? iconic.
π NAME π
__ffs64 β find first set bit in a 64 bit word β¨
π¦ SYNOPSIS π¦
unsigned int __ffs64 (u64 word );
π ARGUMENTS π
wordβ the 64 bit word. that's the value you're handing over, bestie π«Ά
π DESCRIPTION π
On 64 bit arches this is a synonym for __ffs.
Real talk though: the result is not defined if no bits are set π so check that word is non-zero before calling this. like, do the vibe check first, fr fr.
no cap: if you skip that check, the result is not defined β so please don't come crying to me.
π SEE ALSO π
Kernel file ./include/linux/bitops.h is in the group chat, along with the whole squad:
rol64(9)ror64(9)rol32(9)ror32(9)rol16(9)ror16(9)rol8(9)ror8(9)sign_extend32(9)sign_extend64(9)get_count_order_long(9)parity8(9)fns(9)assign_bit(9)__ptr_set_bit(9)__ptr_clear_bit(9)__ptr_test_bit(9)
mwah π source/version: ./include/linux, dated October 2026. __ffs64(9) out. periodt. π§ββοΈ
π¦ 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