view extras/mini-os/include/posix/strings.h @ 19702:878e4c128991

minios: implement ffs, ffsl and ffsll.

The first function is compiled only in case minios is compiled without
newlib, since newlib already provides an implementation for ffs.
On the other hand ffsl and ffsll are always compiled because newlib
misses those functions.
This patch also provides an implementation for __ffsti2 and __ffsdi2
because they are needed by gcc in order to successfully link ffsll.

Signed-off-by: Stefano Stabellini <>
author Keir Fraser <>
date Thu May 28 09:41:59 2009 +0100 (2009-05-28)
parents a905c582a406
line source
1 #ifndef _POSIX_STRINGS_H
2 #define _POSIX_STRINGS_H
4 #include <string.h>
6 #define bzero(ptr, size) (memset((ptr), '\0', (size)), (void) 0)
8 int ffs (int i);
9 int ffsl (long int li);
10 int ffsll (long long int lli);
12 #endif /* _POSIX_STRINGS_H */