1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved
2
.TH "AIO_FSYNC" P 2003 POSIX
5
aio_fsync \- asynchronous file synchronization (\fBREALTIME\fP)
11
int aio_fsync(int\fP \fIop\fP\fB, struct aiocb *\fP\fIaiocbp\fP\fB);
18
The \fIaio_fsync\fP() function shall asynchronously force all I/O
19
operations associated with the file indicated by the file
20
descriptor \fIaio_fildes\fP member of the \fBaiocb\fP structure referenced
21
by the \fIaiocbp\fP argument and queued at the time
22
of the call to \fIaio_fsync\fP() to the synchronized I/O completion
23
state. The function call shall return when the synchronization
24
request has been initiated or queued to the file or device (even when
25
the data cannot be synchronized immediately).
27
If \fIop\fP is O_DSYNC, all currently queued I/O operations shall
28
be completed as if by a call to \fIfdatasync\fP(); that is, as defined
29
for synchronized I/O data integrity completion. If
30
\fIop\fP is O_SYNC, all currently queued I/O operations shall be completed
31
as if by a call to \fIfsync\fP(); that is, as defined for synchronized
32
I/O file integrity completion. If the
33
\fIaio_fsync\fP() function fails, or if the operation queued by \fIaio_fsync\fP()
34
fails, then, as for \fIfsync\fP() and \fIfdatasync\fP(), outstanding
36
operations are not guaranteed to have been completed.
38
If \fIaio_fsync\fP() succeeds, then it is only the I/O that was queued
39
at the time of the call to \fIaio_fsync\fP() that is
40
guaranteed to be forced to the relevant completion state. The completion
41
of subsequent I/O on the file descriptor is not guaranteed
42
to be completed in a synchronized fashion.
44
The \fIaiocbp\fP argument refers to an asynchronous I/O control block.
45
The \fIaiocbp\fP value may be used as an argument to \fIaio_error\fP()
46
and \fIaio_return\fP() in
47
order to determine the error status and return status, respectively,
48
of the asynchronous operation while it is proceeding. When the
49
request is queued, the error status for the operation is [EINPROGRESS].
50
When all data has been successfully transferred, the error
51
status shall be reset to reflect the success or failure of the operation.
52
If the operation does not complete successfully, the
53
error status for the operation shall be set to indicate the error.
54
The \fIaio_sigevent\fP member determines the asynchronous
55
notification to occur as specified in \fISignal Generation and Delivery\fP
57
operations have achieved synchronized I/O completion. All other members
58
of the structure referenced by \fIaiocbp\fP are ignored.
59
If the control block referenced by \fIaiocbp\fP becomes an illegal
60
address prior to asynchronous I/O completion, then the behavior
63
If the \fIaio_fsync\fP() function fails or \fIaiocbp\fP indicates
64
an error condition, data is not guaranteed to have been
65
successfully transferred.
68
The \fIaio_fsync\fP() function shall return the value 0 to the calling
69
process if the I/O operation is successfully queued;
70
otherwise, the function shall return the value -1 and set \fIerrno\fP
71
to indicate the error.
74
The \fIaio_fsync\fP() function shall fail if:
77
The requested asynchronous operation was not queued due to temporary
81
The \fIaio_fildes\fP member of the \fBaiocb\fP structure referenced
82
by the \fIaiocbp\fP argument is not a valid file
83
descriptor open for writing.
86
This implementation does not support synchronized I/O for this file.
89
A value of \fIop\fP other than O_DSYNC or O_SYNC was specified.
92
In the event that any of the queued I/O operations fail, \fIaio_fsync\fP()
93
shall return the error condition defined for \fIread\fP() and \fIwrite\fP().
94
The error is returned in
95
the error status for the asynchronous \fIfsync\fP() operation, which
96
can be retrieved using
99
\fIThe following sections are informative.\fP
103
.SH APPLICATION USAGE
105
The \fIaio_fsync\fP() function is part of the Asynchronous Input and
106
Output option and need not be available on all
111
.SH FUTURE DIRECTIONS
116
\fIfcntl\fP() , \fIfdatasync\fP() , \fIfsync\fP() , \fIopen\fP() ,
117
\fIread\fP() , \fIwrite\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
120
Portions of this text are reprinted and reproduced in electronic form
121
from IEEE Std 1003.1, 2003 Edition, Standard for Information Technology
122
-- Portable Operating System Interface (POSIX), The Open Group Base
123
Specifications Issue 6, Copyright (C) 2001-2003 by the Institute of
124
Electrical and Electronics Engineers, Inc and The Open Group. In the
125
event of any discrepancy between this version and the original IEEE and
126
The Open Group Standard, the original IEEE and The Open Group Standard
127
is the referee document. The original Standard can be obtained online at
128
http://www.opengroup.org/unix/online.html .