logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

aio_fsync.3p (6018B)


  1. '\" et
  2. .TH AIO_FSYNC "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. aio_fsync
  12. \(em asynchronous file synchronization
  13. .SH SYNOPSIS
  14. .LP
  15. .nf
  16. #include <aio.h>
  17. .P
  18. int aio_fsync(int \fIop\fP, struct aiocb *\fIaiocbp\fP);
  19. .fi
  20. .SH DESCRIPTION
  21. The
  22. \fIaio_fsync\fR()
  23. function shall asynchronously perform a file synchronization operation,
  24. as specified by the
  25. .IR op
  26. argument, for I/O operations associated with the file indicated by the
  27. file descriptor
  28. .IR aio_fildes
  29. member of the
  30. .BR aiocb
  31. structure referenced by the
  32. .IR aiocbp
  33. argument and queued at the time of the call to
  34. \fIaio_fsync\fR().
  35. The function call shall return when the synchronization request has been
  36. initiated or queued to the file or device (even when the data cannot be
  37. synchronized immediately).
  38. .P
  39. If
  40. .IR op
  41. is O_DSYNC,
  42. all currently queued I/O operations shall be completed as if by a call to
  43. \fIfdatasync\fR();
  44. that is, as defined for synchronized I/O data integrity completion.
  45. .P
  46. If
  47. .IR op
  48. is O_SYNC,
  49. all currently queued I/O operations shall be completed as if by a call to
  50. \fIfsync\fR();
  51. that is, as defined for synchronized I/O file integrity completion.
  52. If the
  53. \fIaio_fsync\fR()
  54. function fails, or if the operation queued by
  55. \fIaio_fsync\fR()
  56. fails, then outstanding I/O operations are not guaranteed to have been
  57. completed.
  58. .P
  59. If
  60. \fIaio_fsync\fR()
  61. succeeds, then it is only the I/O that was queued at the time of the
  62. call to
  63. \fIaio_fsync\fR()
  64. that is guaranteed to be forced to the relevant completion state. The
  65. completion of subsequent I/O on the file descriptor is not guaranteed
  66. to be completed in a synchronized fashion.
  67. .P
  68. The
  69. .IR aiocbp
  70. argument refers to an asynchronous I/O control block. The
  71. .IR aiocbp
  72. value may be used as an argument to
  73. \fIaio_error\fR()
  74. and
  75. \fIaio_return\fR()
  76. in order to determine the error status and return status, respectively,
  77. of the asynchronous operation while it is proceeding. When the request
  78. is queued, the error status for the operation is
  79. .BR [EINPROGRESS] .
  80. When all data has been successfully transferred, the error status shall
  81. be reset to reflect the success or failure of the operation. If the
  82. operation does not complete successfully, the error status for the
  83. operation shall be set to indicate the error. The
  84. .IR aio_sigevent
  85. member determines the asynchronous notification to occur as specified
  86. in
  87. .IR "Section 2.4.1" ", " "Signal Generation and Delivery"
  88. when all operations have achieved synchronized I/O completion. All
  89. other members of the structure referenced by
  90. .IR aiocbp
  91. are ignored. If the control block referenced by
  92. .IR aiocbp
  93. becomes an illegal address prior to asynchronous I/O completion, then
  94. the behavior is undefined.
  95. .P
  96. If the
  97. \fIaio_fsync\fR()
  98. function fails or
  99. .IR aiocbp
  100. indicates an error condition, data is not guaranteed to have been
  101. successfully transferred.
  102. .SH "RETURN VALUE"
  103. The
  104. \fIaio_fsync\fR()
  105. function shall return the value 0 if the I/O operation is successfully
  106. queued; otherwise, the function shall return the value \-1 and set
  107. .IR errno
  108. to indicate the error.
  109. .SH ERRORS
  110. The
  111. \fIaio_fsync\fR()
  112. function shall fail if:
  113. .TP
  114. .BR EAGAIN
  115. The requested asynchronous operation was not queued due to
  116. temporary resource limitations.
  117. .TP
  118. .BR EBADF
  119. The
  120. .IR aio_fildes
  121. member of the
  122. .BR aiocb
  123. structure referenced by the
  124. .IR aiocbp
  125. argument is not a valid file descriptor.
  126. .TP
  127. .BR EINVAL
  128. This implementation does not support synchronized I/O for this file.
  129. .TP
  130. .BR EINVAL
  131. The
  132. .IR aio_fildes
  133. member of the
  134. .BR aiocb
  135. structure refers to a file on which an
  136. \fIfsync\fR()
  137. operation is not possible.
  138. .TP
  139. .BR EINVAL
  140. A value of
  141. .IR op
  142. other than O_DSYNC or O_SYNC was specified, or O_DSYNC was specified and
  143. the implementation does not provide runtime support for the Synchronized
  144. Input and Output option, or O_SYNC was specified and the implementation
  145. does not provide runtime support for the File Synchronization option.
  146. .P
  147. In the event that any of the queued I/O operations fail,
  148. \fIaio_fsync\fR()
  149. shall return the error condition defined for
  150. \fIread\fR()
  151. and
  152. \fIwrite\fR().
  153. The error is returned in the error status for the asynchronous operation,
  154. which can be retrieved using
  155. \fIaio_error\fR().
  156. .LP
  157. .IR "The following sections are informative."
  158. .SH EXAMPLES
  159. None.
  160. .SH "APPLICATION USAGE"
  161. Note that even if the file descriptor is not open for writing, if
  162. there are any pending write requests on the underlying file, then
  163. that I/O will be completed prior to the return of a call to
  164. \fIaio_error\fR()
  165. or
  166. \fIaio_return\fR()
  167. indicating that the operation has completed.
  168. .SH RATIONALE
  169. None.
  170. .SH "FUTURE DIRECTIONS"
  171. None.
  172. .SH "SEE ALSO"
  173. .IR "\fIaio_error\fR\^(\|)",
  174. .IR "\fIaio_return\fR\^(\|)",
  175. .IR "\fIfcntl\fR\^(\|)",
  176. .IR "\fIfdatasync\fR\^(\|)",
  177. .IR "\fIfsync\fR\^(\|)",
  178. .IR "\fIopen\fR\^(\|)",
  179. .IR "\fIread\fR\^(\|)",
  180. .IR "\fIwrite\fR\^(\|)"
  181. .P
  182. The Base Definitions volume of POSIX.1\(hy2017,
  183. .IR "\fB<aio.h>\fP"
  184. .\"
  185. .SH COPYRIGHT
  186. Portions of this text are reprinted and reproduced in electronic form
  187. from IEEE Std 1003.1-2017, Standard for Information Technology
  188. -- Portable Operating System Interface (POSIX), The Open Group Base
  189. Specifications Issue 7, 2018 Edition,
  190. Copyright (C) 2018 by the Institute of
  191. Electrical and Electronics Engineers, Inc and The Open Group.
  192. In the event of any discrepancy between this version and the original IEEE and
  193. The Open Group Standard, the original IEEE and The Open Group Standard
  194. is the referee document. The original Standard can be obtained online at
  195. http://www.opengroup.org/unix/online.html .
  196. .PP
  197. Any typographical or formatting errors that appear
  198. in this page are most likely
  199. to have been introduced during the conversion of the source files to
  200. man page format. To report such errors, see
  201. https://www.kernel.org/doc/man-pages/reporting_bugs.html .