OSDN Git Service

(split) Import translated manuals from JM CVS Repository.
[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.