{"id":5290,"date":"2022-12-20T18:37:16","date_gmt":"2022-12-20T21:37:16","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/lio_listio-man3p\/"},"modified":"2022-12-20T18:37:16","modified_gmt":"2022-12-20T21:37:16","slug":"lio_listio-man3p","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/lio_listio-man3p\/","title":{"rendered":"LIO_LISTIO (man3p)"},"content":{"rendered":"<h1 align=\"center\">LIO_LISTIO<\/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\">lio_listio \u2014 list directed I\/O<\/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 lio_listio(int <i>mode<\/i>, struct aiocb *restrict const <i>list<\/i>[restrict], <br \/> int <i>nent<\/i>, struct sigevent *restrict <i>sig<\/i>);<\/p>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>lio_listio<\/i>() function shall initiate a list of I\/O requests with a single function call.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>mode<\/i> argument takes one of the values LIO_WAIT or LIO_NOWAIT declared in <i><aio.h><\/i> and determines whether the function returns when the I\/O operations have been completed, or as soon as the operations have been queued. If the <i>mode<\/i> argument is LIO_WAIT, the function shall wait until all I\/O is complete and the <i>sig<\/i> argument shall be ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>mode<\/i> argument is LIO_NOWAIT, the function shall return immediately, and asynchronous notification shall occur, according to the <i>sig<\/i> argument, when all the I\/O operations complete. If <i>sig<\/i> is NULL, then no asynchronous notification shall occur. If <i>sig<\/i> is not NULL, asynchronous notification occurs as specified in <i>Section 2.4.1<\/i>, <i>Signal Generation and Delivery<\/i> when all the requests in <i>list<\/i> have completed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The I\/O requests enumerated by <i>list<\/i> are submitted in an unspecified order.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>list<\/i> argument is an array of pointers to <b>aiocb<\/b> structures. The array contains <i>nent<\/i> elements. The array may contain NULL elements, which shall be ignored.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the buffer pointed to by <i>list<\/i> or the <b>aiocb<\/b> structures pointed to by the elements of the array <i>list<\/i> become illegal addresses before all asynchronous I\/O completed and, if necessary, the notification is sent, then the behavior is undefined. If the buffers pointed to by the <i>aio_buf<\/i> member of the <b>aiocb<\/b> structure pointed to by the elements of the array <i>list<\/i> become illegal addresses prior to the asynchronous I\/O associated with that <b>aiocb<\/b> structure being completed, the behavior is undefined.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_lio_opcode<\/i> field of each <b>aiocb<\/b> structure specifies the operation to be performed. The supported operations are LIO_READ, LIO_WRITE, and LIO_NOP; these symbols are defined in <i><aio.h><\/i>. The LIO_NOP operation causes the list entry to be ignored. If the <i>aio_lio_opcode<\/i> element is equal to LIO_READ, then an I\/O operation is submitted as if by a call to <i>aio_read<\/i>() with the <i>aiocbp<\/i> equal to the address of the <b>aiocb<\/b> structure. If the <i>aio_lio_opcode<\/i> element is equal to LIO_WRITE, then an I\/O operation is submitted as if by a call to <i>aio_write<\/i>() with the <i>aiocbp<\/i> equal to the address of the <b>aiocb<\/b> structure.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_fildes<\/i> member specifies the file descriptor on which the operation is to be performed.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_buf<\/i> member specifies the address of the buffer to or from which the data is transferred.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>aio_nbytes<\/i> member specifies the number of bytes of data to be transferred.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The members of the <b>aiocb<\/b> structure further describe the I\/O operation to be performed, in a manner identical to that of the corresponding <b>aiocb<\/b> structure when used by the <i>aio_read<\/i>() and <i>aio_write<\/i>() functions.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>nent<\/i> argument specifies how many elements are members of the list; that is, the length of the array.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The behavior of this function is altered according to the definitions of synchronized I\/O data integrity completion and synchronized I\/O file integrity completion if synchronized I\/O is enabled on the file associated with <i>aio_fildes<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">For regular files, no data transfer shall occur past the offset maximum established in the open file description associated with <i>aiocbp<\/i>\u2212><i>aio_fildes<\/i>.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If <i>sig<\/i>\u2212><i>sigev_notify<\/i> is SIGEV_THREAD and <i>sig<\/i>\u2212><i>sigev_notify_attributes<\/i> is a non-null pointer and the block pointed to by this pointer becomes an illegal address prior to all asynchronous I\/O being completed, then the behavior is undefined.<\/p>\n<h2>RETURN VALUE <a name=\"RETURN VALUE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>mode<\/i> argument has the value LIO_NOWAIT, the <i>lio_listio<\/i>() function shall return the value zero if the I\/O operations are successfully queued; otherwise, the function shall return the value \u22121 and set <i>errno<\/i> to indicate the error.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">If the <i>mode<\/i> argument has the value LIO_WAIT, the <i>lio_listio<\/i>() function shall return the value zero when all the indicated I\/O has completed successfully. Otherwise, <i>lio_listio<\/i>() shall return a value of \u22121 and set <i>errno<\/i> to indicate the error.<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">In either case, the return value only indicates the success or failure of the <i>lio_listio<\/i>() call itself, not the status of the individual I\/O requests. In some cases one or more of the I\/O requests contained in the list may fail. Failure of an individual request does not prevent completion of any other individual request. To determine the outcome of each I\/O request, the application shall examine the error status associated with each <b>aiocb<\/b> control block. The error statuses so returned are identical to those returned as the result of an <i>aio_read<\/i>() or <i>aio_write<\/i>() function.<\/p>\n<h2>ERRORS <a name=\"ERRORS\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The <i>lio_listio<\/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 resources necessary to queue all the I\/O requests were not available. The application may check the error status for each <b>aiocb<\/b> to determine the individual request(s) that failed.<\/p>\n<\/td>\n<\/tr>\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 number of entries indicated by <i>nent<\/i> would cause the system-wide limit {AIO_MAX} to be exceeded.<\/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>mode<\/i> argument is not a proper value, or the value of <i>nent<\/i> was greater than {AIO_LISTIO_MAX}.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EINTR<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>A signal was delivered while waiting for all I\/O requests to complete during an LIO_WAIT operation. Note that, since each I\/O operation invoked by <i>lio_listio<\/i>() may possibly provoke a signal when it completes, this error return may be caused by the completion of one (or more) of the very I\/O operations being awaited. Outstanding I\/O requests are not canceled, and the application shall examine each list element to determine whether the request was initiated, canceled, or completed.<\/p>\n<\/td>\n<\/tr>\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"9%\">\n<p><b>EIO<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p>One or more of the individual I\/O operations failed. The application may check the error status for each <b>aiocb<\/b> structure to determine the individual request(s) that failed.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%; margin-top: 1em\">In addition to the errors returned by the <i>lio_listio<\/i>() function, if the <i>lio_listio<\/i>() function succeeds or fails with errors of <b>[EAGAIN]<\/b>, <b>[EINTR]<\/b>, or <b>[EIO]<\/b>, then some of the I\/O specified by the list may have been initiated. If the <i>lio_listio<\/i>() function fails with an error code other than <b>[EAGAIN]<\/b>, <b>[EINTR]<\/b>, or <b>[EIO]<\/b>, no operations from the list shall have been initiated. The I\/O operation indicated by each list element can encounter errors specific to the individual read or write function being performed. In this event, the error status for each <b>aiocb<\/b> control block contains the associated error code. The error codes that can be set are the same as would be set by a <i>read<\/i>() or <i>write<\/i>() function, with the following additional error codes possible:<\/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 style=\"margin-top: 1em\"><b>EAGAIN<\/b><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"78%\">\n<p style=\"margin-top: 1em\">The requested I\/O operation was not queued due to resource limitations.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>ECANCELED<\/b><\/p>\n<p style=\"margin-left:22%;\">The requested I\/O was canceled before the I\/O completed due to an explicit <i>aio_cancel<\/i>() request.<\/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=\"7%\">\n<p><b>EFBIG<\/b><\/p>\n<\/td>\n<td width=\"4%\"><\/td>\n<td width=\"78%\">\n<p>The <i>aiocbp<\/i>\u2212><i>aio_lio_opcode<\/i> is LIO_WRITE, the file is a regular file, <i>aiocbp<\/i>\u2212><i>aio_nbytes<\/i> is greater than 0, and the <i>aiocbp<\/i>\u2212><i>aio_offset<\/i> is greater than or equal to the offset maximum in the open file description associated with <i>aiocbp<\/i>\u2212><i>aio_fildes<\/i>.<\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:11%;\"><b>EINPROGRESS<\/b><\/p>\n<p style=\"margin-left:22%;\">The requested I\/O is in progress.<\/p>\n<p style=\"margin-left:11%;\"><b>EOVERFLOW<\/b><\/p>\n<p style=\"margin-left:22%;\">The <i>aiocbp<\/i>\u2212><i>aio_lio_opcode<\/i> is LIO_READ, the file is a regular file, <i>aiocbp<\/i>\u2212><i>aio_nbytes<\/i> is greater than 0, and the <i>aiocbp<\/i>\u2212><i>aio_offset<\/i> is before the end-of-file and is greater than or equal to the offset maximum in the open file description associated with <i>aiocbp<\/i>\u2212><i>aio_fildes<\/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\">None.<\/p>\n<h2>RATIONALE <a name=\"RATIONALE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">Although it may appear that there are inconsistencies in the specified circumstances for error codes, the <b>[EIO]<\/b> error condition applies when any circumstance relating to an individual operation makes that operation fail. This might be due to a badly formulated request (for example, the <i>aio_lio_opcode<\/i> field is invalid, and <i>aio_error<\/i>() returns <b>[EINVAL]<\/b>) or might arise from application behavior (for example, the file descriptor is closed before the operation is initiated, and <i>aio_error<\/i>() returns <b>[EBADF]<\/b>).<\/p>\n<p style=\"margin-left:11%; margin-top: 1em\">The limitation on the set of error codes returned when operations from the list shall have been initiated enables applications to know when operations have been started and whether <i>aio_error<\/i>() is valid for a specific operation.<\/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_read<\/i>(), <i>aio_write<\/i>(), <i>aio_error<\/i>(), <i>aio_return<\/i>(), <i>aio_cancel<\/i>(), <i>close<\/i>(), <i>exec<\/i>, <i>exit<\/i>(), <i>fork<\/i>(), <i>lseek<\/i>(), <i>read<\/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>  lio_listio \u2014 list directed I\/O <\/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":[2178,1594],"class_list":["post-5290","post","type-post","status-publish","format-standard","hentry","category-3pm-perl-llamadas-de-bibliotecas","category-sin-categoria","tag-lio_listio","tag-man3p"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5290","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=5290"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/5290\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=5290"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=5290"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=5290"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}