FERROR

Section: Linux Programmer's Manual (3)
Updated: 2019-03-06
Index JM Home Page
 

名前

clearerr, feof, ferror, fileno - ストリームステータスのチェックとリセット  

書式

#include <stdio.h>

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  

説明

関数 clearerr() は stream で示されるストリームの EOF(end-of-file) 指示子とエラー指示子をクリアする。

関数 feof() は stream で示されるストリームの EOF 指示子をテストし、 セットされていれば 0 以外の数を返す。 EOF 指示子は、関数 clearerr() によってのみクリアすることができる。

関数 ferror() は stream で示されるストリームのエラー指示子をテストし、 セットされていれば 0 以外の数を返す。 エラー指示子は、関数 clearerr() によってのみリセットすることができる。

The function fileno() examines the argument stream and returns the integer file descriptor used to implement this stream. The file descriptor is still owned by stream and will be closed when fclose(3) is called. Duplicate the file descriptor with dup(2) before passing it to code that might close it.

これらの処理を停止せずに行いたいときは、 unlocked_stdio(3) を参照のこと。  

エラー

これらの関数は失敗すべきではなく、また、外部変数 errno に値をセットしない。 (しかし、 fileno() 関数の場合で、引数が有効なストリームでなかった場合、 関数は -1 を返し、 errnoEBADF を設定しなければならない。)  

属性

この節で使用されている用語の説明については、 attributes(7) を参照。
インターフェース 属性
clearerr(), feof(),
ferror(), fileno()
Thread safety MT-Safe
 

準拠

関数 clearerr(), feof(), ferror() は C89, C99, POSIX.1-2001, POSIX.1-2008 に準拠している。

関数 fileno() は POSIX.1-2001 と POSIX.1-2008 に準拠している。  

関連項目

open(2), fdopen(3), stdio(3), unlocked_stdio(3)  

この文書について

この man ページは Linux man-pages プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は https://www.kernel.org/doc/man-pages/ に書かれている。

関連キーワード

関数, stream, clearerr, fileno, FERROR, 指示, feof, ferror, ストリーム, エラー

Linux マニュアル 一覧

[man1] [man2] [man3] [man4] [man5] [man6] [man7] [man8]
[a] [b] [c] [d] [e] [f] [g] [h] [i] [j] [k] [l] [m] [n] [o] [p] [q] [r] [s] [t] [u] [v] [w] [x] [y] [z]

 

Index

名前
書式
説明
エラー
属性
準拠
関連項目
この文書について

This document was created by man2html, using the manual pages.
Time: 12:08:37 GMT, June 11, 2022