1FFS(3)                     Linux Programmer's Manual                    FFS(3)
2
3
4

NAME

6       ffs, ffsl, ffsll - find first bit set in a word
7

SYNOPSIS

9       #include <strings.h>
10
11       int ffs(int i);
12
13       #define _GNU_SOURCE
14       #include <string.h>
15
16       int ffsl(long int i);
17
18       int ffsll(long long int i);
19

DESCRIPTION

21       The  ffs()  function  returns the position of the first (least signifi‐
22       cant) bit set in the word i.  The least significant bit is  position  1
23       and the most significant position is, for example, 32 or 64.  The func‐
24       tions ffsll() and ffsl() do the same but  take  arguments  of  possibly
25       different size.
26

RETURN VALUE

28       These  functions  return  the position of the first bit set, or 0 if no
29       bits are set in i.
30

CONFORMING TO

32       4.3BSD, POSIX.1-2001.
33

NOTES

35       BSD systems have a prototype in <string.h>.
36

SEE ALSO

38       memchr(3), feature_test_macros(7)
39

COLOPHON

41       This page is part of release 3.22 of the Linux  man-pages  project.   A
42       description  of  the project, and information about reporting bugs, can
43       be found at http://www.kernel.org/doc/man-pages/.
44
45
46
47GNU                               2009-04-21                            FFS(3)
Impressum