OSDN Git Service

(split) LDP: Release pages for LDP v3.39.
[linuxjm/LDP_man-pages.git] / release / man3 / fclose.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 .\"     @(#)fclose.3    6.7 (Berkeley) 6/29/91
37 .\"
38 .\" Converted for Linux, Mon Nov 29 15:19:14 1993, faith@cs.unc.edu
39 .\"
40 .\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
41 .\"
42 .\"*******************************************************************
43 .\"
44 .\" This file was generated with po4a. Translate the source file.
45 .\"
46 .\"*******************************************************************
47 .TH FCLOSE 3 2009\-02\-23 GNU "Linux Programmer's Manual"
48 .SH 名前
49 fclose \- ストリームを閉じる
50 .SH 書式
51 \fB#include <stdio.h>\fP
52 .sp
53 \fBint fclose(FILE *\fP\fIfp\fP\fB);\fP
54 .SH 説明
55 \fBfclose\fP()  関数は \fIfp\fP で指されるストリームを (バッファリングされていた全ての出力データを \fBfflush\fP(3)
56 を用いて書き込んで) フラッシュし、 その基となるファイルディスクリプタをクローズする。
57 .SH 返り値
58 関数が正常に終了すると 0 が返される。 正常に終了しなかった場合には \fBEOF\fP が返され、 \fIerrno\fP がエラーを示すために設定される。
59 どちらの場合も、そのストリームに対する (\fBfclose\fP()  へのさらなる呼び出しを含む) それ以上のアクセスは 未定義の動作を生じさせる。
60 .SH エラー
61 .TP 
62 \fBEBADF\fP
63 .\"  This error cannot occur unless you are mixing ANSI C stdio operations and
64 .\"  low-level file operations on the same stream. If you do get this error,
65 .\"  you must have closed the stream's low-level file descriptor using
66 .\"  something like close(fileno(fp)).
67 \fIfp\fP の基となるファイルディスクリプタが不正である。
68 .PP
69 \fBfclose\fP()  関数はこれ以外にも \fBclose\fP(2), \fBwrite\fP(2), \fBfflush\fP(3)
70 のルーチンで失敗することがある。その場合は \fIerrno\fP が、失敗したルーチンで設定された値に設定される。
71 .SH 準拠
72 C89, C99.
73 .SH 注意
74 \fBfclose\fP()  は C ライブラリで提供されたユーザー空間バッファをフラッシュするだけで ある点に注意すること。
75 データを確実に物理的にディスクに記録するためには カーネルバッファも (\fBsync\fP(2)  や \fBfsync\fP(2)  を用いて)
76 フラッシュしなければならない。
77 .SH 関連項目
78 \fBclose\fP(2), \fBfcloseall\fP(3), \fBfflush\fP(3), \fBfopen\fP(3), \fBsetbuf\fP(3)