Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
ffs(3) OSS Library Calls Reference Manual
NAME
ffs - Finds first bit set
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZSTFNSRL
G-series native OSS processes: /G/system/sysnn/zstfnsrl
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <strings.h>
int ffs(int i);
PARAMETERS
i is an integer to examined.
DESCRIPTION
The ffs( ) function examines the i parameter bit-by-bit beginning with the least significant bit and
returns the number of the first bit that is set to 1. The bits are numbered starting with the least
significant bit being one.
NOTES
The ffs( ) function can be called by native processes only.
RETURN VALUES
The ffs( ) function returns the number of the first bit set. If the value of the i parameter is 0
(zero), ffs( ) returns 0 (zero).
ERRORS
None. The ffs( ) function does not set errno.
STANDARDS CONFORMANCE
The ffs( ) function is defined in the XPG4 Version 2 specification.
2−62 Hewlett-Packard Company 527187-017