per the resolution of Austin Group issue #617, these are accepted for
XSI option in POSIX future and thus I'm treating them as standard
functions.
#if defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
int ffs (int);
+int ffsl (long);
+int ffsll (long long);
#endif
int strcasecmp (const char *, const char *);
--- /dev/null
+#include <strings.h>
+#include "atomic.h"
+
+int ffsl(long i)
+{
+ return i ? a_ctz_l(i)+1 : 0;
+}
--- /dev/null
+#include <strings.h>
+#include "atomic.h"
+
+int ffsll(long long i)
+{
+ return i ? a_ctz_64(i)+1 : 0;
+}