.\" Copyright (c) 1990, 1991 The Regents of the University of California. .\" All rights reserved. .\" .\" This code is derived from software contributed to Berkeley by .\" Chris Torek and the American National Standards Committee X3, .\" on Information Processing Systems. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" @(#)ferror.3 6.8 (Berkeley) 6/29/91 .\" .\" .\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu .\" Added remark on EBADF for fileno, aeb, 2001-03-22 .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .\" .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka .\" all rights reserved. .\" Translated Fri Dec 26 10:49:26 JST 1997 .\" by HIROFUMI Nishizuka .\" Updated Sat May 19 JST 2001 by Kentaro Shirakata .\" Updated Fri Nov 2 JST 2001 by Kentaro Shirakata .\" .TH FERROR 3 2019\-03\-06 "" "Linux Programmer's Manual" .SH 名前 clearerr, feof, ferror, fileno \- ストリームステータスのチェックとリセット .SH 書式 \fB#include \fP .PP \fBvoid clearerr(FILE *\fP\fIstream\fP\fB);\fP .PP \fBint feof(FILE *\fP\fIstream\fP\fB);\fP .PP \fBint ferror(FILE *\fP\fIstream\fP\fB);\fP .PP \fBint fileno(FILE *\fP\fIstream\fP\fB);\fP .PP .RS -4 glibc 向けの機能検査マクロの要件 (\fBfeature_test_macros\fP(7) 参照): .RE .PP \fBfileno\fP(): _POSIX_C_SOURCE .SH 説明 関数 \fBclearerr\fP() は \fIstream\fP で示されるストリームの EOF(end\-of\-file) 指示子とエラー指示子をクリアする。 .PP 関数 \fBfeof\fP() は \fIstream\fP で示されるストリームの EOF 指示子をテストし、 セットされていれば 0 以外の数を返す。 EOF 指示子は、関数 \fBclearerr\fP() によってのみクリアすることができる。 .PP 関数 \fBferror\fP() は \fIstream\fP で示されるストリームのエラー指示子をテストし、 セットされていれば 0 以外の数を返す。 エラー指示子は、関数 \fBclearerr\fP() によってのみリセットすることができる。 .PP The function \fBfileno\fP() examines the argument \fIstream\fP and returns the integer file descriptor used to implement this stream. The file descriptor is still owned by \fIstream\fP and will be closed when \fBfclose\fP(3) is called. Duplicate the file descriptor with \fBdup\fP(2) before passing it to code that might close it. .PP これらの処理を停止せずに行いたいときは、 \fBunlocked_stdio\fP(3) を参照のこと。 .SH エラー これらの関数は失敗すべきではなく、また、外部変数 \fIerrno\fP に値をセットしない。 (しかし、 \fBfileno\fP() 関数の場合で、引数が有効なストリームでなかった場合、 関数は \-1 を返し、 \fIerrno\fP に \fBEBADF\fP を設定しなければならない。) .SH 属性 この節で使用されている用語の説明については、 \fBattributes\fP(7) を参照。 .TS allbox; lbw19 lb lb l l l. インターフェース 属性 値 T{ \fBclearerr\fP(), \fBfeof\fP(), .br \fBferror\fP(), \fBfileno\fP() T} Thread safety MT\-Safe .TE .SH 準拠 関数 \fBclearerr\fP(), \fBfeof\fP(), \fBferror\fP() は C89, C99, POSIX.1\-2001, POSIX.1\-2008 に準拠している。 .PP 関数 \fBfileno\fP() は POSIX.1\-2001 と POSIX.1\-2008 に準拠している。 .SH 関連項目 \fBopen\fP(2), \fBfdopen\fP(3), \fBstdio\fP(3), \fBunlocked_stdio\fP(3) .SH この文書について この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 5.10 の一部である。プロジェクトの説明とバグ報告に関する情報は \%https://www.kernel.org/doc/man\-pages/ に書かれている。