| FFS(9) | Kernel Developer's Manual | FFS(9) |
ffs, fls,
flsl — kernel library find
bit routines
#include
<lib/libkern/libkern.h>
int
ffs(int
value);
int
fls(int
value);
int
flsl(long
value);
The
ffs()
function finds the first bit set in value. It has the
same semantics as its libc counterpart ffs(3).
The
fls() and
flsl()
functions find the last bit set in value and return
the index of that bit.
The ffs() function conforms to
IEEE Std 1003.1-2008 (“POSIX.1”).
The ffs() function is based on a vax
instruction of the same name.
| September 10, 2022 | Debian |