.\" t .\" Copyright (C) 2014 Michael Kerrisk .\" .\" %%%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 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH ISFDTYPE 3 2014\-03\-13 Linux "Linux Programmer's Manual" .SH 名前 isfdtype \- ファイルディスクリプターのファイル種別を検査する .SH 書式 .nf \fB#include \fP \fB#include \fP \fBint isfdtype(int \fP\fIfd\fP\fB, int \fP\fIfdtype\fP\fB);\fP .fi .sp .in -4n glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .in .sp \fBisfdtype\fP(): .ad l .RS 4 .PD 0 .TP 4 glibc 2.20 以降: _DEFAULT_SOURCE .TP 4 glibc 2.20 より前: _BSD_SOURCE || _SVID_SOURCE .PD .RE .ad b .SH 説明 \fBisfdtype\fP() 関数はファイルディスクリプター \fIfd\fP がタイプが \fIfdtype\fP のファイルを参照しているかを検査する。 \fIfdtype\fP 引き数には、\fI\fP で定義されている \fBS_IF*\fP 定数のひとつ (\fBS_IFREG\fP など) を指定する。 \fBS_IF*\fP 定数の説明は \fBstat\fP(2) にある。 .SH 返り値 \fBisfdtype\fP() 関数は、ファイルディスクリプター \fIfd\fP がタイプ \fIfdtype\fP であった場合に 1 を返し、そうでない場合に 0 を返す。 エラーの場合、 \-1 を返し、\fIerrno\fP に原因を示す値を設定する。 .SH エラー \fBisfdtype\fP() 関数は \fBfstat\fP(3) と同じエラーで失敗する。 .SH 準拠 \fBisfdtype\fP() 関数はどの標準でも規定されていないが、 POSIX.1g 標準のドラフトに登場したことはある。 OpenBSD と Tru64 UNIX に存在し、おそらく他のシステムにも存在する (OpenBSD と Tru64 UNIX のどちらの場合でも必要なヘッダーファイルは \fI\fP だけであり、POSIX.1g ドラフトに書かれていたのと同じである)。 .SH 注意 移植性が求められるアプリケーションでは \fBfstat\fP(3) を使用すべきである。 .SH 関連項目 \fBfstat\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.79 の一部 である。プロジェクトの説明とバグ報告に関する情報は http://www.kernel.org/doc/man\-pages/ に書かれている。