1 .\" Hey Emacs! This file is -*- nroff -*- source.
3 .\" Copyright (C) 1996 Andries Brouwer (aeb@cwi.nl)
4 .\" Copyright (C) 1996 Markus Kuhn.
6 .\" [This version merged from two independently written pages - aeb]
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.
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.
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
25 .\" Formatted or processed versions of this manual, if unaccompanied by
26 .\" the source, must acknowledge the copyright and authors of this work.
28 .\" 1996-04-12 Andries Brouwer <aeb@cwi.nl>
29 .\" 1996-04-13 Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
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>
41 .\"WORD: synchronize 同期させる
44 .\"WORD: access time アクセス時刻
45 .\"WORD: database データベース
46 .\"WORD: modification time 修正時刻
48 .\"WORD: descriptor ディスクリプター
50 .TH FDATASYNC 2 2007-07-26 "Linux" "Linux Programmer's Manual"
53 .\"O fdatasync \- synchronize a file's in-core data with that on disk
54 fdatasync \- ファイルのメモリ上のデータをディスク上のものと同期させる
57 .B #include <unistd.h>
59 .BI "int fdatasync(int " fd );
62 .\"O Feature Test Macro Requirements for glibc (see
63 .\"O .BR feature_test_macros (7)):
65 .RB ( feature_test_macros (7)
70 _POSIX_C_SOURCE\ >=\ 199309L || _XOPEN_SOURCE\ >=\ 500
74 .\"O flushes all data buffers of a file to disk (before the system
78 .\"O but is not required to update metadata such as the file last access time.
80 は (システム・コールから戻る前に) ファイルの全てのデータ・バッファーを
81 ディスクにフラッシュ (flush) する。これは
83 に似ているが、ファイルの最終アクセス時刻といったメタデータを更新しない。
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
88 .\"O immediately in order to ensure that the written data is physically
89 .\"O stored on the harddisk.
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
95 .\"O If the modification time is not a part of the transaction
98 .\"O can be used to avoid unnecessary inode disk write operations.
99 データベースにアクセスしたり、ログ・ファイルに書き込むような
100 アプリケーションはしばしば小さなデータの断片 (例えばログ・ファイルの一行)
101 を書き込み、それがハードディスクに物理的に格納されることを保証する
106 は常に二回の書き込み操作を行なう: 一つは新しく書き込まれたデータを、
107 もう一つは inode の修正時刻を更新するために。修正時刻がトラザンクション
110 を使用することで不必要なディスクへの inode の書き込み処理を
112 .\"O .SH "RETURN VALUE"
114 .\"O On success, zero is returned.
115 .\"O On error, \-1 is returned, and
117 .\"O is set appropriately.
118 成功した場合は 0 が返される。エラーの場合は \-1 を返し、
126 .\"O is not a valid file descriptor open for writing.
128 が書き込みのためにオープンされた有効なファイル・ディスクリプターではない。
131 .\"O An error occurred during synchronization.
134 .BR EROFS ", " EINVAL
136 .\"O is bound to a special file which does not support synchronization.
138 が同期操作をサポートしていない特殊なファイルを参照している。
139 .\"O .SH "CONFORMING TO"
142 .\"O .SH AVAILABILITY
144 .\"O On POSIX systems on which
145 .\"O .BR fdatasync ()
147 .\"O .B _POSIX_SYNCHRONIZED_IO
150 .\"O to a value greater than 0.
152 .\"O .BR sysconf (3).)
157 .B _POSIX_SYNCHRONIZED_IO
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 の
166 .\" -1 は使用不可、0 は sysconf() を使って尋ねるという意味である。
167 .\" glibc では、この値を 1 としている。
170 .\"O In Linux 2.2 and earlier,
171 .\"O .BR fdatasync ()
172 .\"O is equivalent to
174 .\"O and so has no performance advantage.
179 と等価であり、したがって性能上の利点もない。
183 .BR sync_file_range (2)
185 B.O. Gallmeister, POSIX.4, O'Reilly, pp. 220-223 and 343.