.\" Copyright (c) 1990, 1991, 1993 .\" The Regents of the University of California. All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek. .\" %sccs.include.redist.man% .\" .\" @(#)ffs.3 8.2 (Berkeley) 04/19/94 .\" .Dd .Dt FFS 3 .Os .Sh NAME .Nm ffs .Nd find first bit set in a bit string .Sh SYNOPSIS .Fd #include .Ft int .Fn ffs "int value" .Sh DESCRIPTION The .Fn ffs function finds the first bit set in .Fa value and returns the index of that bit. Bits are numbered starting from 1, starting at the right-most bit. A return value of 0 means that the argument was zero. .Sh SEE ALSO .Xr bitstring 3 .Sh HISTORY The .Fn ffs function appeared in .Bx 4.3 .