OSDN Git Service

(split) Convert contrib and obsolete pages to UTF-8.
[linuxjm/LDP_man-pages.git] / obsolete / man2 / fdatasync.2
1 .\" Hey Emacs! This file is -*- nroff -*- source.
2 .\"
3 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
4 .\" Copyright (C) 1996 Markus Kuhn.
5 .\"
6 .\" [This version merged from two independently written pages - aeb]
7 .\"
8 .\" Permission is granted to make and distribute verbatim copies of this
9 .\" manual provided the copyright notice and this permission notice are
10 .\" preserved on all copies.
11 .\"
12 .\" Permission is granted to copy and distribute modified versions of this
13 .\" manual under the conditions for verbatim copying, provided that the
14 .\" entire resulting derived work is distributed under the terms of a
15 .\" permission notice identical to this one.
16 .\"
17 .\" Since the Linux kernel and libraries are constantly changing, this
18 .\" manual page may be incorrect or out-of-date.  The author(s) assume no
19 .\" responsibility for errors or omissions, or for damages resulting from
20 .\" the use of the information contained herein.  The author(s) may not
21 .\" have taken the same level of care in the production of this manual,
22 .\" which is licensed free of charge, as they might when working
23 .\" professionally.
24 .\"
25 .\" Formatted or processed versions of this manual, if unaccompanied by
26 .\" the source, must acknowledge the copyright and authors of this work.
27 .\"
28 .\" 1996-04-12  Andries Brouwer <aeb@cwi.nl>
29 .\" 1996-04-13  Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
30 .\"
31 .\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
32 .\"         all rights reserved.
33 .\" Translated Sat Feb 22 20:10:07 JST 1997
34 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
35 .\" Modified Mon May  5 19:46:46 JST 1997
36 .\"         by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
37 .\" Updated & Modified Wed May 19 03:24:56 JST 2004
38 .\"         by Yuichi SATO <ysato444@yahoo.co.jp>
39 .\"
40 .\"WORD:        core                    メモリ
41 .\"WORD:        synchronize             同期させる
42 .\"WORD:        buffer                  バッファー
43 .\"WORD:        flush                   フラッシュ
44 .\"WORD:        access time             アクセス時刻
45 .\"WORD:        database                データベース
46 .\"WORD:        modification time       修正時刻
47 .\"WORD:        inode                   inode
48 .\"WORD:        descriptor              ディスクリプター
49 .\"
50 .TH FDATASYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual"
51 .\"O .SH NAME
52 .SH 名前
53 .\"O fdatasync \- synchronize a file's in-core data with that on disk
54 fdatasync \- ファイルのメモリ上のデータをディスク上のものと同期させる
55 .\"O .SH SYNOPSIS
56 .SH 書式
57 .B #include <unistd.h>
58 .sp
59 .BI "int fdatasync(int " fd );
60 .sp
61 .in -4n
62 .\"O Feature Test Macro Requirements for glibc (see
63 .\"O .BR feature_test_macros (7)):
64 glibc 向けの機能検査マクロの要件
65 .RB ( feature_test_macros (7)
66 参照):
67 .in
68 .sp
69 .BR fdatasync ():
70 _POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500
71 .\"O .SH DESCRIPTION
72 .SH 説明
73 .\"O .BR fdatasync ()
74 .\"O flushes all data buffers of a file to disk (before the system
75 .\"O call returns).
76 .\"O It resembles
77 .\"O .BR fsync (2)
78 .\"O but is not required to update metadata such as the file last access time.
79 .BR fdatasync ()
80 は (システム・コールから戻る前に) ファイルの全てのデータ・バッファーを
81 ディスクにフラッシュ (flush) する。これは
82 .BR fsync (2)
83 に似ているが、ファイルの最終アクセス時刻といったメタデータを更新しない。
84
85 .\"O Applications that access databases or log files often write a tiny
86 .\"O data fragment (e.g., one line in a log file) and then call
87 .\"O .BR fsync (2)
88 .\"O immediately in order to ensure that the written data is physically
89 .\"O stored on the harddisk.
90 .\"O Unfortunately,
91 .\"O .BR fsync (2)
92 .\"O will always initiate two write operations: one for the newly written
93 .\"O data and another one in order to update the modification time stored
94 .\"O in the inode.
95 .\"O If the modification time is not a part of the transaction
96 .\"O concept
97 .\"O .BR fdatasync ()
98 .\"O can be used to avoid unnecessary inode disk write operations.
99 データベースにアクセスしたり、ログ・ファイルに書き込むような
100 アプリケーションはしばしば小さなデータの断片 (例えばログ・ファイルの一行)
101 を書き込み、それがハードディスクに物理的に格納されることを保証する
102 ために、すぐに
103 .BR fsync (2)
104 を呼び出す。不幸なことに、
105 .BR fsync (2)
106 は常に二回の書き込み操作を行なう: 一つは新しく書き込まれたデータを、
107 もう一つは inode の修正時刻を更新するために。修正時刻がトラザンクション
108 に関係なければ、
109 .BR fdatasync ()
110 を使用することで不必要なディスクへの inode の書き込み処理を
111 避けることができる。
112 .\"O .SH "RETURN VALUE"
113 .SH 返り値
114 .\"O On success, zero is returned.
115 .\"O On error, \-1 is returned, and
116 .\"O .I errno
117 .\"O is set appropriately.
118 成功した場合は 0 が返される。エラーの場合は \-1 を返し、
119 .I errno
120 に適切な値が設定される。
121 .\"O .SH ERRORS
122 .SH エラー
123 .TP
124 .B EBADF
125 .\"O .I fd
126 .\"O is not a valid file descriptor open for writing.
127 .I fd
128 が書き込みのためにオープンされた有効なファイル・ディスクリプターではない。
129 .TP
130 .B EIO
131 .\"O An error occurred during synchronization.
132 同期操作の間にエラーが起こった。
133 .TP
134 .BR EROFS ", " EINVAL
135 .\"O .I fd
136 .\"O is bound to a special file which does not support synchronization.
137 .I fd
138 が同期操作をサポートしていない特殊なファイルを参照している。
139 .\"O .SH "CONFORMING TO"
140 .SH 準拠
141 POSIX.1-2001.
142 .\"O .SH AVAILABILITY
143 .SH 可用性
144 .\"O On POSIX systems on which
145 .\"O .BR fdatasync ()
146 .\"O is available,
147 .\"O .B _POSIX_SYNCHRONIZED_IO
148 .\"O is defined in
149 .\"O .I <unistd.h>
150 .\"O to a value greater than 0.
151 .\"O (See also
152 .\"O .BR sysconf (3).)
153 .BR fdatasync ()
154 が利用可能な POSIX システムでは、
155 .I <unistd.h>
156 において
157 .B _POSIX_SYNCHRONIZED_IO
158 が 0 より大きい値に定義されている
159 .RB ( sysconf (3)
160 を参照すること)。
161 .\"O .\" POSIX.1-2001: It shall be defined to -1 or 0 or 200112L.
162 .\"O .\" -1: unavailable, 0: ask using sysconf().
163 .\"O .\" glibc defines them to 1.
164 .\" POSIX.1-2001 では、この値を -1, 0, 200112L の
165 .\" どれかに定義すべきとしている。
166 .\" -1 は使用不可、0 は sysconf() を使って尋ねるという意味である。
167 .\" glibc では、この値を 1 としている。
168 .\"O .SH NOTES
169 .SH 注意
170 .\"O In Linux 2.2 and earlier,
171 .\"O .BR fdatasync ()
172 .\"O is equivalent to
173 .\"O .BR fsync (2),
174 .\"O and so has no performance advantage.
175 Linux 2.2 以前では、
176 .BR fdatasync ()
177
178 .BR fsync (2)
179 と等価であり、したがって性能上の利点もない。
180 .\"O .SH "SEE ALSO"
181 .SH 関連項目
182 .BR fsync (2),
183 .BR sync_file_range (2)
184 .br
185 B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343.