libc/newlib/libc/misc/ffs.c
Yaakov Selkowitz 191b4f35bc misc: remove TRAD_SYNOPSIS
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-12-01 03:41:50 -06:00

33 lines
431 B
C

/*
FUNCTION
<<ffs>>---find first bit set in a word
INDEX
ffs
SYNOPSIS
#include <strings.h>
int ffs(int <[word]>);
DESCRIPTION
<<ffs>> returns the first bit set in a word.
RETURNS
<<ffs>> returns 0 if <[c]> is 0, 1 if <[c]> is odd, 2 if <[c]> is a multiple of
2, etc.
PORTABILITY
<<ffs>> is not ANSI C.
No supporting OS subroutines are required. */
#include <strings.h>
int
ffs(int i)
{
return (__builtin_ffs(i));
}