]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/aio_fsync.3
e2c4b2f52ad28d895bd1c8b7ceda839a6689eec6
[thirdparty/man-pages.git] / man3 / aio_fsync.3
1 .\" Copyright (c) 2003 Andries Brouwer (aeb@cwi.nl)
2 .\"
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
4 .\"
5 .TH AIO_FSYNC 3 2021-03-22 "" "Linux Programmer's Manual"
6 .SH NAME
7 aio_fsync \- asynchronous file synchronization
8 .SH LIBRARY
9 Real-time library
10 .RI ( librt ", " \-lrt )
11 .SH SYNOPSIS
12 .nf
13 .B "#include <aio.h>"
14 .PP
15 .BI "int aio_fsync(int " op ", struct aiocb *" aiocbp );
16 .fi
17 .SH DESCRIPTION
18 The
19 .BR aio_fsync ()
20 function does a sync on all outstanding asynchronous I/O operations
21 associated with
22 .IR aiocbp\->aio_fildes .
23 (See
24 .BR aio (7)
25 for a description of the
26 .I aiocb
27 structure.)
28 .PP
29 More precisely, if
30 .I op
31 is
32 .BR O_SYNC ,
33 then all currently queued I/O operations shall be
34 completed as if by a call of
35 .BR fsync (2),
36 and if
37 .I op
38 is
39 .BR O_DSYNC ,
40 this call is the asynchronous analog of
41 .BR fdatasync (2).
42 .PP
43 Note that this is a request only; it does not wait for I/O completion.
44 .PP
45 Apart from
46 .IR aio_fildes ,
47 the only field in the structure pointed to by
48 .I aiocbp
49 that is used by this call is the
50 .I aio_sigevent
51 field (a
52 .I sigevent
53 structure, described in
54 .BR sigevent (7)),
55 which indicates the desired type of asynchronous notification at completion.
56 All other fields are ignored.
57 .SH RETURN VALUE
58 On success (the sync request was successfully queued)
59 this function returns 0.
60 On error, \-1 is returned, and
61 .I errno
62 is set to indicate the error.
63 .SH ERRORS
64 .TP
65 .B EAGAIN
66 Out of resources.
67 .TP
68 .B EBADF
69 .I aio_fildes
70 is not a valid file descriptor open for writing.
71 .TP
72 .B EINVAL
73 Synchronized I/O is not supported for this file, or
74 .I op
75 is not
76 .B O_SYNC
77 or
78 .BR O_DSYNC .
79 .TP
80 .B ENOSYS
81 .BR aio_fsync ()
82 is not implemented.
83 .SH VERSIONS
84 The
85 .BR aio_fsync ()
86 function is available since glibc 2.1.
87 .SH ATTRIBUTES
88 For an explanation of the terms used in this section, see
89 .BR attributes (7).
90 .ad l
91 .nh
92 .TS
93 allbox;
94 lbx lb lb
95 l l l.
96 Interface Attribute Value
97 T{
98 .BR aio_fsync ()
99 T} Thread safety MT-Safe
100 .TE
101 .hy
102 .ad
103 .sp 1
104 .SH CONFORMING TO
105 POSIX.1-2001, POSIX.1-2008.
106 .SH SEE ALSO
107 .BR aio_cancel (3),
108 .BR aio_error (3),
109 .BR aio_read (3),
110 .BR aio_return (3),
111 .BR aio_suspend (3),
112 .BR aio_write (3),
113 .BR lio_listio (3),
114 .BR aio (7),
115 .BR sigevent (7)