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
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu)
.\"
.\" 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.
.\"
.\" Japanese Version Copyright (c) 1997 HANATAKA Shinya
.\" all rights reserved.
.\" Translated Sat Feb 22 20:14:46 JST 1997
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\" Modified Sat May 19 10:14:44 JST 2001
.\" by HANATAKA Shinya <hanataka@abyss.rim.or.jp>
.\"
.\"WORD: core
.\"WORD: disk ǥ
.\"WORD: synchronize Ʊ
.\"WORD: descriptor ǥץ
.\"
.TH FSYNC 2 "2001-04-18" "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
.B fsync
ϥեΥʬƤǥ˥ԡƤ
ꤷΤ֤줿ȥǥХ𤹤ޤԤġ
ޤǡ(stat)롣ϤΥե뤬¸ߤ
Ƥǥ쥯ȥΥȥ꤬ǥؽޤ줿Ȥݾڤ
櫓ǤϤʤ
ݾڤ뤿ˤŪˤΥǥ쥯ȥΥե롦ǥץ
ФƤ
.B fsync
ɬפ롣
.B fdatasync
.BR fsync
ȤۤȤƱǤ뤬桼ǡΤߤФmtime atime
褦ʥǡФƱʤۤäƤ롣
.SH ֤
硢֤롣顼ξ硢\-1 ֤졢
.I errno
Ŭڤꤵ롣
.SH 顼
.TP
.B EBADF
.I fd
ߤΤ˥ץ줿ե롦ǥץǤʤ
.TP
.B EIO
Ʊδ֤˥顼ȯ
.TP
.BR EROFS ", " EINVAL
.I fd
ƱݡȤƤʤüʥեȤƤ롣
.SH
ϡɥǥνߥå夬ͭˤʤäƤ硢
.BR fsync / fdatasync
äƤȤƤ⡢ºݤˤϱʵŪʵΤ֤Ƥʤ
ʤ
.\" See
.\" .BR hdparm (8)
.\" for how to disable that cache for IDE disks.
.LP
ext2 ե롦ƥब
.I sync
ץĤǥޥȤƤ硢
.B fsync
ǥǥ쥯ȥꡦȥۤΤƱ롣
.LP
2.4 ΥͥǤϵʥե
.B fsync
Ѥ뤳ȤϸΨ礬롣
̤ˡȤ
.BR open (2)
κݤ
.I O_SYNC
ե饰ѤΤɤ⤷ʤ
.SH
POSIX.1b ( POSIX.4)
.SH Ϣ
.BR bdflush (2),
.BR open (2),
.BR sync (2),
.BR mount (8),
.BR sync (8),
.BR update (8)
|