.\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk) .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" References consulted: .\" Linux libc source code .\" Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991) .\" 386BSD man pages .\" Modified Sat Jul 24 19:39:35 1993 by Rik Faith (faith@cs.unc.edu) .\" .\" Modified 2003 Walter Harms (walter.harms@informatik.uni-oldenburg.de) .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Thu Dec 18 16:26:22 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated Wed Jan 9 JST 2002 by Kentaro Shirakata .\" Updated Mon Sep 1 JST 2003 by Kentaro Shirakata .\" .TH FFS 3 2014\-04\-14 GNU "Linux Programmer's Manual" .SH 名前 ffs, ffsl, ffsll \- ワードの中で最初にセットされているビットの検出 .SH 書式 .nf \fB#include \fP .sp \fBint ffs(int \fP\fIi\fP\fB);\fP .sp \fB#include \fP .sp \fBint ffsl(long int \fP\fIi\fP\fB);\fP .sp \fBint ffsll(long long int \fP\fIi\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .PD 0 .ad l .sp \fBffs\fP(): .RS 4 .TP 4 glibc 2.10 以降: _SVID_SOURCE || _BSD_SOURCE || _POSIX_C_SOURCE\ >=\ 200809L || _XOPEN_SOURCE\ >=\ 700 || .TP glibc 2.10 より前: none .RE .PP \fBffsl\fP(), \fBffsll\fP(): .RS 4 _GNU_SOURCE .RE .ad .PD .SH 説明 \fBffs\fP() 関数は、ワード \fIi\fP の中で最初にセットされている (最下位)ビットの位置を返す。 最下位ビットの位置は 1、最上位ビットの位置は例えば 32 や 64 である。 \fBffsll\fP() 関数と \fBffsl\fP() 関数も同様だが、 異なったサイズの引数をとる。 .SH 返り値 これらの関数は、最初にセットされているビットの位置を返し、 \fIi\fP のどのビットもセットされていなければ 0 を返す。 .SH 属性 .SS "マルチスレッディング (pthreads(7) 参照)" 関数 \fBffs\fP(), \fBffsl\fP(), \fBffsll\fP() はスレッドセーフである。 .SH 準拠 \fBffs\fP(): 4.3BSD, POSIX.1\-2001. 関数 \fBffsl\fP() と \fBffsll\fP() は glibc による拡張である。 .SH 注意 BSD システムでは \fI\fP にプロトタイプがある。 .SH 関連項目 \fBmemchr\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.65 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。