Today I discovered ffs(3) is part of glibc. It's a family member of the GCC extensions __builtin_clz(), _ctz(), and _ffs(), for finding the first set bit in a word (dword, qword, multiple widths exist). See: http://en.wikipedia.org/wiki/Find_first_set
These functions are useful because they can be mapped to a single instruction, BSF on x86.
These functions are useful because they can be mapped to a single instruction, BSF on x86.