File: fsync.2

package info (click to toggle)
manpages-ja 0.5.0.0.20061115-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 19,788 kB
  • ctags: 4
  • sloc: sh: 13,215; perl: 157; makefile: 117
file content (150 lines) | stat: -rw-r--r-- 4,917 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) and
.\" and Copyright 2006 Michael Kerrisk <mtk-manpages@gmx.net>
.\"
.\" Permission is granted to make and distribute verbatim copies of this
.\" manual provided the copyright notice and this permission notice are
.\" preserved on all copies.
.\"
.\" Permission is granted to copy and distribute modified versions of this
.\" manual under the conditions for verbatim copying, provided that the
.\" entire resulting derived work is distributed under the terms of a
.\" permission notice identical to this one.
.\" 
.\" Since the Linux kernel and libraries are constantly changing, this
.\" manual page may be incorrect or out-of-date.  The author(s) assume no
.\" responsibility for errors or omissions, or for damages resulting from
.\" the use of the information contained herein.  The author(s) may not
.\" have taken the same level of care in the production of this manual,
.\" which is licensed free of charge, as they might when working
.\" professionally.
.\" 
.\" Formatted or processed versions of this manual, if unaccompanied by
.\" the source, must acknowledge the copyright and authors of this work.
.\"
.\" Modified 21 Aug 1994 by Michael Chastain <mec@shell.portal.com>:
.\"   Removed note about old libc (pre-4.5.26) translating to 'sync'.
.\" Modified 15 Apr 1995 by Michael Chastain <mec@shell.portal.com>:
.\"   Added `see also' section.
.\" Modified 13 Apr 1996 by Markus Kuhn <mskuhn@cip.informatik.uni-erlangen.de>
.\"   Added remarks about fdatasync.
.\" Modified Fri Jan 31 16:27:42 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 31 Jan 1997 by Eric S. Raymond <esr@thyrsus.com>
.\" Modified 18 Apr 2001 by Andi Kleen
.\"   Fix description to describe what it really does; add a few caveats.
.\" 2006-04-28, mtk, substantial rewrite of various parts.
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\"         all rights reserved.
.\" Translated 1997-02-22, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified 2001-05-19, HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Updated 2005-09-06, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>
.\" Updated 2006-07-30, Kentaro Shirakata <argrath@ub32.org>
.\"
.\"WORD:	core			
.\"WORD:	disk			ǥ
.\"WORD:	synchronize		Ʊ
..\"
.TH FSYNC 2 2006-04-28 "Linux 1.3.85" "Linux Programmer's Manual"
.SH ̾
fsync \- ˤեƤ򥹥ȥ졼ǥХΤΤƱ
.SH 
.B #include <unistd.h>
.sp
.BI "int fsync(int " fd );
.sp
.BI "int fdatasync(int " fd );
.SH 
.BR fsync ()
ϥե뵭һ
.I fd
ǻȤեΡ줿ǻäƤǡ
(Ĥޤꡢ줿Хåեåڡ)
Υե뤬°ǥǥХ(ޤϤ¾α³ȥ졼ǥХ)
ž(֥եå)롣
θƤӽФžäȥǥХ𤹤ޤǥ֥å롣
ޤե˷ӤĤ᥿ǡ(
.BR stat (2)
)եå夹롣

.BR fsync ()
θƤӽФϡե뤬¸ߤƤǥ쥯ȥΥȥ꤬ǥ
񤭹ޤ줿Ȥݾڤ櫓ǤϤʤ
ݾڤ뤿ˤŪˤΥǥ쥯ȥΥե뵭һҤФƤ
.BR fsync ()
ɬפ롣

.BR fdatasync ()

.BR fsync ()
ƱͤǤ뤬
³ǡɤ߹ߤˤΥ᥿ǡɬפˤʤʤ¤ꡢ
ѹ줿᥿ǡեå夷ʤ
㤨С
st_atime  st_mtime
(줾ǽǽ;
.BR stat (2)
) ѹϥեåɬפȤʤ
ʤʤ餳ϰ³ǡɤ߹ߤ
ɬפǤϤʤǤ롣
ե륵(
.BR ftruncate (2)
Ǥ
.I st_size
)ѹϥ᥿ǡΥեå夬ɬפǤ롣
.BR fdatasync (2)
ϡƤΥ᥿ǡǥƱɬפΤʤ
ץꥱФơǥ򸺤餹ȤǤ롣
.SH ֤
硢֤롣顼ξ硢\-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B EBADF
.I fd
񤭹ߤΤ˥ץ󤵤줿ե뵭һҤǤʤ
.TP
.B EIO
Ʊδ֤˥顼ȯ
.TP
.BR EROFS ", " EINVAL
.I fd
Ʊ򥵥ݡȤƤʤüʥե򻲾ȤƤ롣
.SH 
äȤʤϡɥǥν񤭹ߥå夬ͭˤʤäƤ硢
.BR fsync () 
/ 
.BR fdatasync ()
äƤȤƤ⡢ºݤˤϱ³ŪʵΤ
֤Ƥʤʤ
.\" IDE ǥΥå̵ˤˡˤĤƤ
.\" .BR hdparm (8)
.\" 򻲾ȤΤȡ
.LP
ext2 ե롦ƥब
.I sync
ץĤǥޥȤƤ硢
.BR fsync ()
ǥǥ쥯ȥꡦȥۤΤƱ롣
.LP
2.4 ΥͥǤϵʥե
.BR fsync ()
Ѥ뤳ȤϸΨ礬롣
̤ˡȤ
.BR open (2)
κݤ
.I O_SYNC
ե饰ѤΤɤ⤷ʤ
.SH 
POSIX.1-2001
.SH Ϣ
.BR bdflush (2),
.BR open (2),
.BR sync (2),
.BR sync_file_range (2),
.BR hdparm (8),
.BR mount (8),
.BR sync (8),
.BR update (8)