ferrorのヘルプ・マニュアル
日本語 英語
ferror --help
man ferror
FERROR(3) Linux Programmer’s Manual FERROR(3)
名前
clearerr, feof, ferror, fileno - ストリームステータスのチェックとリセッ
ト
書式
#include
void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);
glibc 向けの機能検査マクロの要件 (feature_test_macros(7) 参照):
fileno(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
説明
関数 clearerr() は stream で示されるストリームの EOF(end-of-file) 指 示
子とエラー指示子をクリアする。
関数 feof() は stream で示されるストリームの EOF 指示子をテストし、セッ
トされていれば 0 以外の数を返す。 EOF 指示子は、関数 clearerr() によ っ
てのみクリアすることができる。
関 数 ferror() は stream で示されるストリームのエラー指示子をテストし、
セットされていれば 0 以外の数を返す。エラー指示子は、関数 clearerr() に
よってのみリセットすることができる。
関 数 fileno() は、引数 stream を調べ、その整数のディスクリプターを返す
。
ロックせずにこれらの処理を行いたいときは、 unlocked_stdio(3) を参照のこ
と。
エラー
これらの関数は失敗すべきではなく、また、外部変数 errno に値をセットしな
い。 (しかし、 fileno() 関数の場合で、引数が有効なストリームでなかっ た
場合、関数は -1 を返し、 errno に EBADF を設定しなければならない。)
準拠
関数 clearerr(), feof(), ferror() は C89 と C99 に準拠している。
関連項目
open(2), fdopen(3), stdio(3), unlocked_stdio(3)
2008-08-29 FERROR(3)
FERROR(3) Linux Programmer’s Manual FERROR(3)
NAME
clearerr, feof, ferror, fileno - check and reset stream status
SYNOPSIS
#include
void clearerr(FILE *stream);
int feof(FILE *stream);
int ferror(FILE *stream);
int fileno(FILE *stream);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
fileno(): _POSIX_C_SOURCE >= 1 || _XOPEN_SOURCE || _POSIX_SOURCE
DESCRIPTION
The function clearerr() clears the end-of-file and error indicators for
the stream pointed to by stream.
The function feof() tests the end-of-file indicator for the stream
pointed to by stream, returning non-zero if it is set. The end-of-file
indicator can only be cleared by the function clearerr().
The function ferror() tests the error indicator for the stream pointed
to by stream, returning non-zero if it is set. The error indicator can
only be reset by the clearerr() function.
The function fileno() examines the argument stream and returns its
integer descriptor.
For non-locking counterparts, see unlocked_stdio(3).
ERRORS
These functions should not fail and do not set the external variable
errno. (However, in case fileno() detects that its argument is not a
valid stream, it must return -1 and set errno to EBADF.)
CONFORMING TO
The functions clearerr(), feof(), and ferror() conform to C89 and C99.
SEE ALSO
open(2), fdopen(3), stdio(3), unlocked_stdio(3)
COLOPHON
This page is part of release 3.22 of the Linux man-pages project. A
description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
2008-08-29 FERROR(3)