OSDN Git Service

8cdce5b03d7554a633efb45dec349a2c01fb434c
[linuxjm/LDP_man-pages.git] / release / man3 / ferror.3
1 .\" Copyright (c) 1990, 1991 The Regents of the University of California.
2 .\" All rights reserved.
3 .\"
4 .\" This code is derived from software contributed to Berkeley by
5 .\" Chris Torek and the American National Standards Committee X3,
6 .\" on Information Processing Systems.
7 .\"
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
10 .\" are met:
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\"    notice, this list of conditions and the following disclaimer in the
15 .\"    documentation and/or other materials provided with the distribution.
16 .\" 3. All advertising materials mentioning features or use of this software
17 .\"    must display the following acknowledgement:
18 .\"     This product includes software developed by the University of
19 .\"     California, Berkeley and its contributors.
20 .\" 4. Neither the name of the University nor the names of its contributors
21 .\"    may be used to endorse or promote products derived from this software
22 .\"    without specific prior written permission.
23 .\"
24 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" SUCH DAMAGE.
35 .\"
36 .\"     @(#)ferror.3    6.8 (Berkeley) 6/29/91
37 .\"
38 .\"
39 .\" Converted for Linux, Mon Nov 29 14:24:40 1993, faith@cs.unc.edu
40 .\" Added remark on EBADF for fileno, aeb, 2001-03-22
41 .\"
42 .\" Japanese Version Copyright (c) 1997 HIROFUMI Nishizuka
43 .\"     all rights reserved.
44 .\" Translated Fri Dec 26 10:49:26 JST 1997
45 .\"     by HIROFUMI Nishizuka <nishi@rpts.cl.nec.co.jp>
46 .\" Updated Sat May 19 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
47 .\" Updated Fri Nov  2 JST 2001 by Kentaro Shirakata <argrath@ub32.org>
48 .\"
49 .TH FERROR 3  2008-08-29 "" "Linux Programmer's Manual"
50 .SH 名前
51 clearerr, feof, ferror, fileno \- ストリームステータスのチェックとリセット
52 .SH 書式
53 .B #include <stdio.h>
54 .sp
55 .BI "void clearerr(FILE *" stream );
56
57 .BI "int feof(FILE *" stream );
58
59 .BI "int ferror(FILE *" stream );
60
61 .BI "int fileno(FILE *" stream );
62 .sp
63 .in -4n
64 glibc 向けの機能検査マクロの要件
65 .RB ( feature_test_macros (7)
66 参照):
67 .in
68 .sp
69 .BR fileno ():
70 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
71 .SH 説明
72 関数
73 .BR clearerr ()
74
75 .I stream
76 で示されるストリームの EOF(end-of-file) 指示子とエラー指示子をクリアする。
77 .PP
78 関数
79 .BR feof ()
80
81 .I stream
82 で示されるストリームの EOF 指示子をテストし、
83 セットされていれば 0 以外の数を返す。
84 EOF 指示子は、関数
85 .BR clearerr ()
86 によってのみクリアすることができる。
87 .PP
88 関数
89 .BR ferror ()
90
91 .I stream
92 で示されるストリームのエラー指示子をテストし、
93 セットされていれば 0 以外の数を返す。
94 エラー指示子は、関数
95 .BR clearerr ()
96 によってのみリセットすることができる。
97 .PP
98 関数
99 .BR fileno ()
100 は、引数
101 .I stream
102 を調べ、その整数のディスクリプターを返す。
103 .PP
104 ロックせずにこれらの処理を行いたいときは、
105 .BR unlocked_stdio (3)
106 を参照のこと。
107 .SH エラー
108 これらの関数は失敗すべきではなく、また、外部変数
109 .I errno
110 に値をセットしない。
111 (しかし、
112 .BR fileno ()
113 関数の場合で、引数が有効なストリームでなかった場合、
114 関数は \-1 を返し、
115 .I errno
116
117 .B EBADF
118 を設定しなければならない。)
119 .SH 準拠
120 関数
121 .BR clearerr (),
122 .BR feof (),
123 .BR ferror ()
124 は C89 と C99 に準拠している。
125 .SH 関連項目
126 .BR open (2),
127 .BR fdopen (3),
128 .BR stdio (3),
129 .BR unlocked_stdio (3)