OSDN Git Service

(split) LDP: Restore and add Copyrights for draft pages
[linuxjm/LDP_man-pages.git] / draft / man3 / fflush.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 .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB)
9 .\" Redistribution and use in source and binary forms, with or without
10 .\" modification, are permitted provided that the following conditions
11 .\" are met:
12 .\" 1. Redistributions of source code must retain the above copyright
13 .\"    notice, this list of conditions and the following disclaimer.
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in the
16 .\"    documentation and/or other materials provided with the distribution.
17 .\" 3. All advertising materials mentioning features or use of this software
18 .\"    must display the following acknowledgement:
19 .\"     This product includes software developed by the University of
20 .\"     California, Berkeley and its contributors.
21 .\" 4. Neither the name of the University nor the names of its contributors
22 .\"    may be used to endorse or promote products derived from this software
23 .\"    without specific prior written permission.
24 .\"
25 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
26 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
28 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
29 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" SUCH DAMAGE.
36 .\" %%%LICENSE_END
37 .\"
38 .\"     @(#)fflush.3    5.4 (Berkeley) 6/29/91
39 .\"
40 .\" Converted for Linux, Mon Nov 29 15:22:01 1993, faith@cs.unc.edu
41 .\"
42 .\" Modified 2000-07-22 by Nicolás Lichtmaier <nick@debian.org>
43 .\" Modified 2001-10-16 by John Levon <moz@compsoc.man.ac.uk>
44 .\"
45 .\"*******************************************************************
46 .\"
47 .\" This file was generated with po4a. Translate the source file.
48 .\"
49 .\"*******************************************************************
50 .\"
51 .\" Japanese Version Copyright (c) 1997-2000 YOSHINO Takashi and NAKANO Takeo
52 .\"       all rights reserved.
53 .\" Translated 1997-02-13,YOSHINO Takashi <yoshino@civil.jcn.nihon-u.ac.jp>
54 .\" Update & Modified 1999-03-01, NAKANO Takeo <nakano@apm.seikei.ac.jp>
55 .\" Update & Modified 2000-09-21, NAKANO Takeo
56 .\" Updated 2001-11-02, Kentaro Shirakata <argrath@ub32.org>
57 .\" Updated 2010-04-10, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v3.24
58 .\"
59 .TH FFLUSH 3 2013\-07\-15 GNU "Linux Programmer's Manual"
60 .SH 名前
61 fflush \- ストリームの内容を強制的に出力(フラッシュ)する
62 .SH 書式
63 \fB#include <stdio.h>\fP
64 .sp
65 \fBint fflush(FILE *\fP\fIstream\fP\fB);\fP
66 .SH 説明
67 出力ストリームに関しては、 \fBfflush\fP()  は、ユーザー空間でバッファリングされているすべてのデータを 指定された出力に書き出す
68 (フラッシュする)、 もしくはストリーム \fIstream\fP の下位にある書き込み関数を用いてこのストリームを更新する。 入力ストリームに関しては、
69 \fBfflush\fP()  は、対応するファイルから取得されたが、アプリケーションからは 読み出されていないバッファデータを全て破棄する。
70 ストリームは開いた状態のままであり、 この関数によって何の影響も受けない。
71 .PP
72 \fIstream\fP 引数が .BR NULL ならば、 \fBfflush\fP()  は開いている\fIすべての\fP出力ストリームをフラッシュする。
73 .PP
74 これらの処理をロックせずに行いたいときは、 \fBunlocked_stdio\fP(3)  を参照のこと。
75 .SH 返り値
76 成功すると 0 が返される。 その他の場合には \fBEOF\fP が返され、 \fIerrno\fP が、エラーに対応した値に設定される。
77 .SH エラー
78 .TP 
79 \fBEBADF\fP
80 \fIStream\fP は開いているストリームではない。 あるいはストリームは書き込み用ではない。
81 .PP
82 \fBfflush\fP()  関数は \fBwrite\fP(2)  に関して規定されているエラーで失敗することもある。 この場合 \fIerrno\fP
83 もその値に設定される。
84 .SH 属性
85 .SS "マルチスレッディング (pthreads(7) 参照)"
86 関数 \fBfflush\fP() はスレッドセーフである。
87 .SH 準拠
88 C89, C99, POSIX.1\-2001, POSIX.1\-2008.
89
90 .\" Verified on: Solaris 8.
91 標準では、入力ストリームに対する動作は規定されていない。 他のほとんどの実装は Linux と同じ動作をする。
92 .SH 注意
93 \fBfflush\fP()  は、 C ライブラリが与えているユーザー空間のバッファしかフラッシュしない。
94 データが物理的にディスクに保存されることを保証したければ、 カーネルバッファもフラッシュしなければならない。 これには例えば \fBsync\fP(2)  や
95 \fBfsync\fP(2)  を用いる。
96 .SH 関連項目
97 \fBfsync\fP(2), \fBsync\fP(2), \fBwrite\fP(2), \fBfclose\fP(3), \fBfopen\fP(3),
98 \fBsetbuf\fP(3), \fBunlocked_stdio\fP(3)
99 .SH この文書について
100 この man ページは Linux \fIman\-pages\fP プロジェクトのリリース 3.53 の一部
101 である。プロジェクトの説明とバグ報告に関する情報は
102 http://www.kernel.org/doc/man\-pages/ に書かれている。