{"id":5186,"date":"2022-12-20T18:37:11","date_gmt":"2022-12-20T21:37:11","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/aio_fsync-man3p\/"},"modified":"2022-12-20T18:37:11","modified_gmt":"2022-12-20T21:37:11","slug":"aio_fsync-man3p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/aio_fsync-man3p\/","title":{"rendered":"AIO_FSYNC (man3p)"},"content":{"rendered":"<h1 align=\"center\">AIO_FSYNC<\/h1>\n<p> <a href=\"#PROLOG\">PROLOG<\/a><br \/> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#RETURN VALUE\">RETURN VALUE<\/a><br \/> <a href=\"#ERRORS\">ERRORS<\/a><br \/> <a href=\"#EXAMPLES\">EXAMPLES<\/a><br \/> <a href=\"#APPLICATION USAGE\">APPLICATION USAGE<\/a><br \/> <a href=\"#RATIONALE\">RATIONALE<\/a><br \/> <a href=\"#FUTURE DIRECTIONS\">FUTURE DIRECTIONS<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#COPYRIGHT\">COPYRIGHT<\/a> <\/p>\n<hr>\n<h2>PROLOG <a name=\"PROLOG\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">This manual page is part of the POSIX Programmer\u2019s Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.<\/p>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">aio_fsync \u2014 asynchronous file synchronization<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">#include <aio.h><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">int aio_fsync(int <i>op<\/i>, struct aiocb *<i>aiocbp<\/i>);<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_fsync<\/i>() function shall asynchronously perform a file synchronization operation, as specified by the <i>op<\/i> argument, for I\/O operations associated with the file indicated by the file descriptor <i>aio_fildes<\/i> member of the <b>aiocb<\/b> structure referenced by the <i>aiocbp<\/i> argument and queued at the time of the call to <i>aio_fsync<\/i>(). The function call shall return when the synchronization request has been initiated or queued to the file or device (even when the data cannot be synchronized immediately).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>op<\/i> is O_DSYNC, all currently queued I\/O operations shall be completed as if by a call to <i>fdatasync<\/i>(); that is, as defined for synchronized I\/O data integrity completion.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>op<\/i> is O_SYNC, all currently queued I\/O operations shall be completed as if by a call to <i>fsync<\/i>(); that is, as defined for synchronized I\/O file integrity completion. If the <i>aio_fsync<\/i>() function fails, or if the operation queued by <i>aio_fsync<\/i>() fails, then outstanding I\/O operations are not guaranteed to have been completed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>aio_fsync<\/i>() succeeds, then it is only the I\/O that was queued at the time of the call to <i>aio_fsync<\/i>() that is guaranteed to be forced to the relevant completion state. The completion of subsequent I\/O on the file descriptor is not guaranteed to be completed in a synchronized fashion.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aiocbp<\/i> argument refers to an asynchronous I\/O control block. The <i>aiocbp<\/i> value may be used as an argument to <i>aio_error<\/i>() and <i>aio_return<\/i>() in order to determine the error status and return status, respectively, of the asynchronous operation while it is proceeding. When the request is queued, the error status for the operation is <b>[EINPROGRESS]<\/b>. When all data has been successfully transferred, the error status shall be reset to reflect the success or failure of the operation. If the operation does not complete successfully, the error status for the operation shall be set to indicate the error. The <i>aio_sigevent<\/i> member determines the asynchronous notification to occur as specified in <i>Section 2.4.1<\/i>, <i>Signal Generation and Delivery<\/i> when all operations have achieved synchronized I\/O completion. All other members of the structure referenced by <i>aiocbp<\/i> are ignored. If the control block referenced by <i>aiocbp<\/i> becomes an illegal address prior to asynchronous I\/O completion, then the behavior is undefined.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>aio_fsync<\/i>() function fails or <i>aiocbp<\/i> indicates an error condition, data is not guaranteed to have been successfully transferred.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_fsync<\/i>() function shall return the value 0 if the I\/O operation is successfully queued; otherwise, the function shall return the value \u22121 and set <i>errno<\/i> to indicate the error.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_fsync<\/i>() function shall fail if:<\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EAGAIN<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The requested asynchronous operation was not queued due to temporary resource limitations.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EBADF<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The <i>aio_fildes<\/i> member of the <b>aiocb<\/b> structure referenced by the <i>aiocbp<\/i> argument is not a valid file descriptor.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>This implementation does not support synchronized I\/O for this file.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>The <i>aio_fildes<\/i> member of the <b>aiocb<\/b> structure refers to a file on which an <i>fsync<\/i>() operation is not possible.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINVAL<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>A value of <i>op<\/i> other than O_DSYNC or O_SYNC was specified, or O_DSYNC was specified and the implementation does not provide runtime support for the Synchronized Input and Output option, or O_SYNC was specified and the implementation does not provide runtime support for the File Synchronization option.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">In the event that any of the queued I\/O operations fail, <i>aio_fsync<\/i>() shall return the error condition defined for <i>read<\/i>() and <i>write<\/i>(). The error is returned in the error status for the asynchronous operation, which can be retrieved using <i>aio_error<\/i>().<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>The following sections are informative.<\/i><\/p>\n<h2>EXAMPLES <a name=\"EXAMPLES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>APPLICATION USAGE <a name=\"APPLICATION USAGE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Note that even if the file descriptor is not open for writing, if there are any pending write requests on the underlying file, then that I\/O will be completed prior to the return of a call to <i>aio_error<\/i>() or <i>aio_return<\/i>() indicating that the operation has completed.<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>FUTURE DIRECTIONS <a name=\"FUTURE DIRECTIONS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">None.<\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><i>aio_error<\/i>(), <i>aio_return<\/i>(), <i>fcntl<\/i>(), <i>fdatasync<\/i>(), <i>fsync<\/i>(), <i>open<\/i>(), <i>read<\/i>(), <i>write<\/i>()<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The Base Definitions volume of POSIX.1-2017, <b><aio.h><\/b><\/p>\n<h2>COPYRIGHT <a name=\"COPYRIGHT\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology &#8212; Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http:\/\/www.opengroup.org\/unix\/online.html .<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https:\/\/www.kernel.org\/doc\/man-pages\/reporting_bugs.html .<\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  aio_fsync \u2014 asynchronous file synchronization <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3779,1],"tags":[2076,1594],"class_list":["post-5186","post","type-post","status-publish","format-standard","hentry","category-3pm-perl-llamadas-de-bibliotecas","category-sin-categoria","tag-aio_fsync","tag-man3p"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=5186"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5186\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}