OSDN Git Service

a3e311ef31ba5d84f20da68939004d13ac094a61
[linuxjm/LDP_man-pages.git] / draft / 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 .\"O .SH NAME
51 .SH 名前
52 .\"O clearerr, feof, ferror, fileno \- check and reset stream status
53 clearerr, feof, ferror, fileno \- ストリームステータスのチェックとリセット
54 .\"O .SH SYNOPSIS
55 .SH 書式
56 .B #include <stdio.h>
57 .sp
58 .BI "void clearerr(FILE *" stream );
59
60 .BI "int feof(FILE *" stream );
61
62 .BI "int ferror(FILE *" stream );
63
64 .BI "int fileno(FILE *" stream );
65 .sp
66 .in -4n
67 .\"O Feature Test Macro Requirements for glibc (see
68 .\"O .BR feature_test_macros (7)):
69 glibc 向けの機能検査マクロの要件
70 .RB ( feature_test_macros (7)
71 参照):
72 .in
73 .sp
74 .BR fileno ():
75 _POSIX_C_SOURCE\ >=\ 1 || _XOPEN_SOURCE || _POSIX_SOURCE
76 .\"O .SH DESCRIPTION
77 .SH 説明
78 .\"O The function
79 .\"O .BR clearerr ()
80 .\"O clears the end-of-file and error indicators for the stream pointed to by
81 .\"O .IR stream .
82 関数
83 .BR clearerr ()
84
85 .I stream
86 で示されるストリームの EOF(end-of-file) 指示子とエラー指示子をクリアする。
87 .PP
88 .\"O The function
89 .\"O .BR feof ()
90 .\"O tests the end-of-file indicator for the stream pointed to by
91 .\"O .IR stream ,
92 .\"O returning nonzero if it is set.
93 .\"O The end-of-file indicator can only be
94 .\"O cleared by the function
95 .\"O .BR clearerr ().
96 関数
97 .BR feof ()
98
99 .I stream
100 で示されるストリームの EOF 指示子をテストし、
101 セットされていれば 0 以外の数を返す。
102 EOF 指示子は、関数
103 .BR clearerr ()
104 によってのみクリアすることができる。
105 .PP
106 .\"O The function
107 .\"O .BR ferror ()
108 .\"O tests the error indicator for the stream pointed to by
109 .\"O .IR stream ,
110 .\"O returning nonzero if it is set.
111 .\"O The error indicator can only be reset by the
112 .\"O .BR clearerr ()
113 .\"O function.
114 関数
115 .BR ferror ()
116
117 .I stream
118 で示されるストリームのエラー指示子をテストし、
119 セットされていれば 0 以外の数を返す。
120 エラー指示子は、関数
121 .BR clearerr ()
122 によってのみリセットすることができる。
123 .PP
124 .\"O The function
125 .\"O .BR fileno ()
126 .\"O examines the argument
127 .\"O .I stream
128 .\"O and returns its integer descriptor.
129 関数
130 .BR fileno ()
131 は、引数
132 .I stream
133 を調べ、その整数のディスクリプターを返す。
134 .PP
135 .\"O For nonlocking counterparts, see
136 .\"O .BR unlocked_stdio (3).
137 ロックせずにこれらの処理を行いたいときは、
138 .BR unlocked_stdio (3)
139 を参照のこと。
140 .\"O .SH ERRORS
141 .SH エラー
142 .\"O These functions should not fail and do not set the external variable
143 .\"O .IR errno .
144 これらの関数は失敗すべきではなく、また、外部変数
145 .I errno
146 に値をセットしない。
147 .\"O (However, in case
148 .\"O .BR fileno ()
149 .\"O detects that its argument is not a valid stream, it must
150 .\"O return \-1 and set
151 .\"O .I errno
152 .\"O to
153 .\"O .BR EBADF .)
154 (しかし、
155 .BR fileno ()
156 関数の場合で、引数が有効なストリームでなかった場合、
157 関数は \-1 を返し、
158 .I errno
159
160 .B EBADF
161 を設定しなければならない。)
162 .\"O .SH "CONFORMING TO"
163 .SH 準拠
164 .\"O The functions
165 .\"O .BR clearerr (),
166 .\"O .BR feof (),
167 .\"O and
168 .\"O .BR ferror ()
169 .\"O conform to C89 and C99.
170 関数
171 .BR clearerr (),
172 .BR feof (),
173 .BR ferror ()
174 は C89 と C99 に準拠している。
175 .\"O .SH "SEE ALSO"
176 .SH 関連項目
177 .BR open (2),
178 .BR fdopen (3),
179 .BR stdio (3),
180 .BR unlocked_stdio (3)