1 .\" $NetBSD: aio_fsync.3,v 1.4 2009/03/10 13:23:39 joerg Exp $
3 .\" Copyright (c) 2007 The NetBSD Foundation, Inc.
4 .\" All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
16 .\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
17 .\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
18 .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
19 .\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 .\" POSSIBILITY OF SUCH DAMAGE.
32 .Nd asynchronous data synchronization of file (REALTIME)
38 .Fn aio_fsync "int op" "struct aiocb *aiocbp"
42 system call allows the calling process to force all modified data
43 associated with the file descriptor
44 .Fa aiocbp-\*[Gt]aio_fildes
45 to be flushed to the stable storage device.
46 The call returns immediately after the synchronization request has been
47 enqueued to the descriptor; the synchronization may or may not have
48 completed at the time the call returns.
49 If the request could not be enqueued, generally due to invalid arguments,
50 the call returns without having enqueued the request.
54 argument could be set only to
72 .Dv _POSIX_PRIORITIZED_IO
73 is defined, and the descriptor supports it, then the enqueued
74 operation is submitted at a priority equal to that of the calling
76 .Fa aiocbp-\*[Gt]aio_reqprio .
80 pointer may be subsequently used as an argument to
84 in order to determine return or error status for the enqueued operation
85 while it is in progress.
87 The asynchronous I/O control buffer
89 should be zeroed before the
91 system call to avoid passing bogus context information to the kernel.
93 Modifications of the Asynchronous I/O Control Block structure after
94 the request has been enqueued, but before the request has completed,
101 system call will fail if:
104 The request was not queued because of system resource limitations.
107 The following conditions may be synchronously detected when the
109 system call is made, or asynchronously, at any time thereafter.
110 If they are detected at call time,
114 appropriately; otherwise the
116 system call must be called, and will return \-1, and
118 must be called to determine the actual value that would have been
124 .Fa aiocbp-\*[Gt]aio_fildes
125 is invalid for writing.
127 This implementation does not support synchronized I/O for this file,
130 argument is neither set to
145 system call is expected to conform to the
151 system call first appeared in