~ubuntu-branches/ubuntu/breezy/manpages-posix/breezy

« back to all changes in this revision

Viewing changes to man3p/aio_fsync.3p

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Paolo Lovergine
  • Date: 2004-08-27 10:47:48 UTC
  • Revision ID: james.westby@ubuntu.com-20040827104748-8zjxz9vva0n0t4sm
Tags: 1.67-3
rules: linking manpages-posix not manpages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.\" Copyright (c) 2001-2003 The Open Group, All Rights Reserved 
 
2
.TH "AIO_FSYNC" P 2003 POSIX
 
3
.\" aio_fsync 
 
4
.SH NAME
 
5
aio_fsync \- asynchronous file synchronization (\fBREALTIME\fP)
 
6
.SH SYNOPSIS
 
7
.LP
 
8
\fB#include <aio.h>
 
9
.br
 
10
.sp
 
11
int aio_fsync(int\fP \fIop\fP\fB, struct aiocb *\fP\fIaiocbp\fP\fB);
 
12
\fP
 
13
\fB
 
14
.br
 
15
\fP
 
16
.SH DESCRIPTION
 
17
.LP
 
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).
 
26
.LP
 
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
 
35
I/O
 
36
operations are not guaranteed to have been completed.
 
37
.LP
 
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.
 
43
.LP
 
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
 
56
when all
 
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
 
61
is undefined.
 
62
.LP
 
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.
 
66
.SH RETURN VALUE
 
67
.LP
 
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.
 
72
.SH ERRORS
 
73
.LP
 
74
The \fIaio_fsync\fP() function shall fail if:
 
75
.TP 7
 
76
.B EAGAIN
 
77
The requested asynchronous operation was not queued due to temporary
 
78
resource limitations.
 
79
.TP 7
 
80
.B EBADF
 
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.
 
84
.TP 7
 
85
.B EINVAL
 
86
This implementation does not support synchronized I/O for this file.
 
87
.TP 7
 
88
.B EINVAL
 
89
A value of \fIop\fP other than O_DSYNC or O_SYNC was specified.
 
90
.sp
 
91
.LP
 
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
 
97
\fIaio_error\fP().
 
98
.LP
 
99
\fIThe following sections are informative.\fP
 
100
.SH EXAMPLES
 
101
.LP
 
102
None.
 
103
.SH APPLICATION USAGE
 
104
.LP
 
105
The \fIaio_fsync\fP() function is part of the Asynchronous Input and
 
106
Output option and need not be available on all
 
107
implementations.
 
108
.SH RATIONALE
 
109
.LP
 
110
None.
 
111
.SH FUTURE DIRECTIONS
 
112
.LP
 
113
None.
 
114
.SH SEE ALSO
 
115
.LP
 
116
\fIfcntl\fP() , \fIfdatasync\fP() , \fIfsync\fP() , \fIopen\fP() ,
 
117
\fIread\fP() , \fIwrite\fP() , the Base Definitions volume of IEEE\ Std\ 1003.1-2001,
 
118
\fI<aio.h>\fP
 
119
.SH COPYRIGHT
 
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 .