FFS(3POSIX)
π FFS(3POSIX) β the POSIX Programmer's Manual, bestie edition π
okay so real talk before we dive in: this page lives in the POSIX Programmer's Manual, and it's filed under FFS(3POSIX).
π«Ά PROLOG
bestie, listen. This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ β so go consult the corresponding Linux manual page for details on Linux behavior β or, plot twist, the interface might not even be implemented on Linux at all. check before you ship, fr fr π
β¨ NAME β¨
ffs β find first set bit π
πΈ SYNOPSIS πΈ
#include <strings.h>
int ffs(int i);
π DESCRIPTION π
so ffs() shall find the first bit set in i, starting from the least significant bit, and hand you back the index of that bit. obsessed.
and here's the little detail everyone forgets: bits are numbered starting at one β and "one" is the least significant bit. not zero. one. it's giving 1-indexed, and we respect it π
π RETURN VALUE π
ffs() shall return the index of the first bit set. π
and if i is 0? then ffs() shall return 0. that's it. that's the whole vibe. zero bits set, zero returned β¨
π ERRORS π
No errors are defined. not a single one. iconic behavior, honestly.
The following sections are informative. π¦
π EXAMPLES π
None. (yeah. none. we're all just vibing off the description.)
π§ APPLICATION USAGE π§
None.
π₯ RATIONALE π₯
None.
β FUTURE DIRECTIONS β
None.
π SEE ALSO π
- The Base Definitions volume of POSIX.1β2017,
<strings.h>
π COPYRIGHT π
Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .
β οΈ Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .
and that's the whole page, bestie π«Ά this absolute queen of a manpage was brought to you by IEEE/The Open Group, dated 2017, filed under FFS(3POSIX). no cap. go find some bits. π β¨
π¦ where this page comes from
- debian bookworm: manpages-posix-dev 2017a-2 Β· Other
- debian trixie: manpages-posix-dev 2017a-2 Β· Other
- ubuntu jammy: manpages-posix-dev 2017a-2 Β· Other
- ubuntu noble: manpages-posix-dev 2017a-2 Β· Other
- ubuntu resolute: manpages-posix-dev 2017a-2build1 Β· Other
- ubuntu stonking: manpages-posix-dev 2017a-2.1 Β· Other
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms