FFS(9)

NAME
ffs, fls, flsl - kernel library find bit routines

SYNOPSIS
#include <lib/libkern/libkern.h>
int
ffs(int value);
int
fls(int value);
int
flsl(long value);

DESCRIPTION
The ffs() function finds the first bit set in value. It has the same semantics as it's libc counterpart ffs(3).

The fls() and flsl() functions find the last bit set in value and return the index of that bit.

SEE ALSO
ffs(3)

STANDARDS
The ffs() function conforms to p1003.1-2008.

HISTORY
The ffs() function is based on a vax instruction of the same name.