man pages section 3: Basic Library Functions

Exit Print View

Updated: July 2014
 
 

flsl(3C)

Name

ffs, ffsl, ffsll, fls, flsl, flsll - find first or last bit set in a bit string

Synopsis

#include <strings.h>

int ffs(int value);
int ffsl(long value);
int ffsll(long long value);
int fls(int value);
int flsl(long value);
flsll(long long value);

Description

The ffs(), ffsl(), and ffsll() functions find the first bit set in value and return the position of that bit.

The fls(), fssl(), and flsll() functions find the last bit set in value and return the position of that bit.

Bits are numbered starting at one (the least significant bit).

Return Values

These functions return the position of the first bit set, or 0 if no bits are set in value.

Errors

No errors are defined.

Attributes

See attributes(5) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Interface Stability
Committed
MT-Level
MT-Safe
Standard

See Also

attributes(5), standards(5)