OpenBSD manual page server

Manual Page Search Parameters

FFS(9) Kernel Developer's Manual FFS(9)

ffs, fls, flslkernel library find bit routines

#include <lib/libkern/libkern.h>

int
ffs(int value);

int
fls(int value);

int
flsl(long value);

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

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

ffs(3)

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 OpenBSD-current