Debian Codegraph @

upstream/debian-trixie/man3/aio_fsync.3

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