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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
|
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" Copyright (c) 2006 Andrew Morton <akpm@osdl.org>
.\" and Copyright 2006 Michael Kerrisk <mtk.manpages@gmail.com>
.\"
.\" 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.
.\"
.\" 2006-07-05 Initial creation, Michael Kerrisk based on
.\" Andrew Morton's comments in fs/sync.c
.\"
.\" Japanese Version Copyright (c) 2007 Akihiro MOTOKI
.\" all rights reserved.
.\" Translated 2007-01-09, Akihiro MOTOKI <amotoki@dd.iij4u.or.jp>, LDP v2.43
.\" Updated 2008-08-06, Akihiro MOTOKI, LDP v3.05
.\"
.TH SYNC_FILE_RANGE 2 2008-05-27 "Linux" "Linux Programmer's Manual"
.SH ̾
sync_file_range \- sync a file segment with disk
.SH
.nf
.B #define _GNU_SOURCE
.B #include <fcntl.h>
.BI "int sync_file_range(int " fd ", off64_t " offset ", off64_t " nbytes ,
.BI " unsigned int " flags );
.fi
.SH
.BR sync_file_range ()
Ȥȡեǥץ
.I fd
ǻȤ륪ץ줿եΥǥȤƱ˴ؤơ
٤椬ǽȤʤ롣
.I offset
ϡƱԤեΰγϥХȤǤ롣
.I nbytes
ˤƱԤΰĹХñ̤ǻꤹ롣
.I nbytes
0 ξϡ
.I offset
եޤǤХȤƱ롣
ƱϥƥΥڡñ̤ǹԤ롣
.I offset
ϥڡˤ碌ڤ겼졢
.I (offset+nbytes-1)
ϥڡˤ碌ڤ夲롣
ӥåȥޥ
.I flags
ˤϰʲͤꤹ뤳ȤǤ:
.TP
.B SYNC_FILE_RANGE_WAIT_BEFORE
餫νߤԤˡꤵ줿ΰΥڡ
ФԤ褦˥ǥХɥ饤ФˤǤȯԤƤ
ڡνФƴλΤԤġ
.TP
.B SYNC_FILE_RANGE_WRITE
ꤵ줿ΰΥڡǡФȯԤƤʤ
Ƥ dirty (åѹƤ) ڡ
ФϤ롣
ꥯȥ塼礭¿⤦Ȥˤϡ
ν (block) ǽդ뤳ȡ
.TP
.B SYNC_FILE_RANGE_WAIT_AFTER
餫ν߸ˡꤵ줿ΰƤΥڡ
ФԤΤԤġ
.PP
.I flags
0 ꤷ硢⤷ʤȤɽ
.SS ܺ
ǤϤɤեΥǡνФԤʤ
äơץꥱμ¤˺ѤߤΥǥ֥å
¹Ԥʤ¤ꡢåθǤǡѲǽǤ
ݾڤϤʤ
.B SYNC_FILE_RANGE_WAIT_BEFORE
.B SYNC_FILE_RANGE_WAIT_AFTER
I/O 顼
.B ENOSPC
֤ФƤӽФˤξ֤
.I flags
ΩĥӥåȤȤ߹碌ʲ˼:
.TP
.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE
ꤵ줿ϰΥڡǡ
.BR sync_file_range ()
ƤӽФ줿ݤ dirty ǤäƤΥڡ
μ¤˽ФоݤȤʤ褦ˤ롣
ϡstart-write-for-data-integrity
(ǡݤΤν߳Ϥ) Ǥ롣
.TP
.B SYNC_FILE_RANGE_WRITE
ꤵ줿ϰΥڡǡ߽ФǤʤƤ dirty ڡ
ФϤ롣ƱΥǥؤΥեå (flush-to-disk)
Ǥ롣ǡݤɬפȤƤŬڤǤϤʤ
.TP
.BR SYNC_FILE_RANGE_WAIT_BEFORE " (or " SYNC_FILE_RANGE_WAIT_AFTER )
ꤵ줿ϰƤΥڡνФδλԤġ
Υե饰ϡ˹Ԥ줿
.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE
θ˻ѤǤδλԤ̤뤳ȤǤ롣
.TP
.B SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | \
SYNC_FILE_RANGE_WAIT_AFTER
write-for-data-integrity
(ǡݤΤν) Ǥꡢꤵ줿ϰΡ
.BR sync_file_range ()
ƤФ줿 dirty ƤΥڡ
ǥ˳Ǽ뤳Ȥݾڤ롣
.SH ֤
ξ硢
.BR sync_file_range ()
0 ֤Ԥξ硢\-1 ֤
.I error
˥顼ͤꤹ롣
.SH 顼
.TP
.B EBADF
.I fd
ͭʥեǥץǤϤʤ
.TP
.B EINVAL
.I flags
ʥӥåȤꤵƤ롣ޤ
.I offset
.I nbytes
Ǥ롣
.TP
.B EIO
I/O 顼
.TP
.B ENOMEM
Ǥ롣
.TP
.B ENOSPC
ǥΰǤ롣
.TP
.B ESPIPE
.I fd
̾Υե롢֥åǥХǥ쥯ȥꡢܥå
ʳΤΤؤƤ롣
.\" FIXME . (bug?) Actually, how can 'fd' refer to a symbolic link (S_ISLNK)?
.\" (In userspace at least) it isn't possible to obtain a file descriptor
.\" for a symbolic link.
.SH С
.BR sync_file_range ()
ϥͥ 2.6.17 Linux о줷
.SH
Υƥॳ Linux ȼǤꡢ
ܿɬפʥץǤϻѤ٤Ǥ롣
.SH Ϣ
.BR fdatasync (2),
.BR fsync (2),
.BR msync (2),
.BR sync (2),
.BR feature_test_macros (7)
|