Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / misc / ffs.c
blob068f254812deb62aca7c9dc1c36d9f451142529d
1 /*
2 FUNCTION
3 <<ffs>>---find first bit set in a word
5 INDEX
6 ffs
8 SYNOPSIS
9 #include <strings.h>
10 int ffs(int <[word]>);
12 DESCRIPTION
14 <<ffs>> returns the first bit set in a word.
16 RETURNS
17 <<ffs>> returns 0 if <[c]> is 0, 1 if <[c]> is odd, 2 if <[c]> is a multiple of
18 2, etc.
20 PORTABILITY
21 <<ffs>> is not ANSI C.
23 No supporting OS subroutines are required. */
25 #include <strings.h>
27 int
28 ffs(int i)
31 return (__builtin_ffs(i));