diff options
| author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-13 16:05:47 +0000 | 
|---|---|---|
| committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-01-13 16:05:47 +0000 | 
| commit | f434fe1237e333414c9aa8e906c60f2630f1f11b (patch) | |
| tree | ec554f27ccb99efb17cf19602b6279f86f0db08b /lib/libc/string/ffs.3 | |
| parent | 8746a69a28843500a0acb39fcfb411f9f107c663 (diff) | |
Notes
Diffstat (limited to 'lib/libc/string/ffs.3')
| -rw-r--r-- | lib/libc/string/ffs.3 | 41 | 
1 files changed, 35 insertions, 6 deletions
diff --git a/lib/libc/string/ffs.3 b/lib/libc/string/ffs.3 index 5b5fb6f00e21..cb9c6cc3931f 100644 --- a/lib/libc/string/ffs.3 +++ b/lib/libc/string/ffs.3 @@ -38,23 +38,44 @@  .Dt FFS 3  .Os  .Sh NAME -.Nm ffs -.Nd find first bit set in a bit string +.Nm ffs , +.Nm ffsl , +.Nm fls , +.Nm flsl +.Nd find first or last bit set in a bit string  .Sh LIBRARY  .Lb libc  .Sh SYNOPSIS  .In strings.h  .Ft int  .Fn ffs "int value" +.Ft int +.Fn ffsl "long value" +.Ft int +.Fn fls "int value" +.Ft int +.Fn flsl "long value"  .Sh DESCRIPTION  The  .Fn ffs -function finds the first bit set in +and +.Fn ffsl +functions find the first bit set in  .Fa value -and returns the index of that bit. +and return the index of that bit. +.Pp +The +.Fn fls +and +.Fn flsl +functions find the last bit set in +.Fa value +and return the index of that bit. +.Pp  Bits are numbered starting from 1, starting at the right-most -bit. -A return value of 0 means that the argument was zero. +(least significant) bit. +A return value of zero from any of these functions means that the +argument was zero.  .Sh SEE ALSO  .Xr bitstring 3  .Sh HISTORY @@ -69,3 +90,11 @@ before it was moved to  for  .St -p1003.1-2001  compliance. +.Pp +The +.Fn ffsl , +.Fn fls +and +.Fn flsl +functions appeared in +.Fx 5.3 .  | 
