⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 lio_listio.3

📁 xen 3.2.2 源码
💻 3
字号:
.TH  lio_listio 3 2002-09-12 "Linux 2.4" Linux AIO".SH NAMElio_listio - List directed I/O.SH SYNOPSYS.B #include <errno.h>.br.B #include <libaio.h>.LP.BI "int lio_listio (int mode, struct aiocb *const list[], int nent, struct sigevent *sig)".nf.SH DESCRIPTIONBesides these functions with the more or less traditional interface,POSIX.1b also defines a function which can initiate more than oneoperation at a time, and which can handle freely mixed read and writeoperations.  It is therefore similar to a combination of .IR readvand.IR "writev".The .IR "lio_listio"function can be used to enqueue an arbitrarynumber of read and write requests at one time.  The requests can all bemeant for the same file, all for different files or every solution inbetween..IR "lio_listio"gets the .IR "nent"requests from the array pointed toby .IR "list".  The operation to be performed is determined by the.IR "aio_lio_opcode"member in each element of .IR "list".  If thisfield is .B "LIO_READ"a read operation is enqueued, similar to a callof .IR "aio_read"for this element of the array (except that the waythe termination is signalled is different, as we will see below).  Ifthe .IR "aio_lio_opcode"member is .B "LIO_WRITE"a write operationis enqueued.  Otherwise the .IR "aio_lio_opcode"must be .B "LIO_NOP"in which case this element of .IR "list"is simply ignored.  This``operation'' is useful in situations where one has a fixed array of.IR "struct aiocb"elements from which only a few need to be handled ata time.  Another situation is where the .IR "lio_listio"call wascanceled before all requests are processed  and the remaining requests have to be reissued.The other members of each element of the array pointed to by.IR "list"must have values suitable for the operation as described inthe documentation for .IR "aio_read"and .IR "aio_write"above.The .IR "mode"argument determines how .IR "lio_listio"behaves afterhaving enqueued all the requests.  If .IR "mode"is .B "LIO_WAIT"itwaits until all requests terminated.  Otherwise .IR "mode"must be.B "LIO_NOWAIT"and in this case the function returns immediately afterhaving enqueued all the requests.  In this case the caller gets anotification of the termination of all requests according to the.IR "sig"parameter.  If .IR "sig"is .B "NULL"no notification issend.  Otherwise a signal is sent or a thread is started, just asdescribed in the description for .IR "aio_read"or .IR "aio_write".When the sources are compiled with .B "_FILE_OFFSET_BITS == 64", thisfunction is in fact .IR "lio_listio64"since the LFS interfacetransparently replaces the normal implementation..SH "RETURN VALUES"If .IR "mode"is .B "LIO_WAIT", the return value of .IR "lio_listio"is .IR 0when all requests completed successfully.  Otherwise thefunction return .IR 1and .IR "errno"is set accordingly.  To findout which request or requests failed one has to use the .IR "aio_error"function on all the elements of the array .IR "list".In case .IR "mode"is .B "LIO_NOWAIT", the function returns .IR 0ifall requests were enqueued correctly.  The current state of the requestscan be found using .IR "aio_error"and .IR "aio_return"as describedabove.  If .IR "lio_listio"returns .IR -1in this mode, theglobal variable .IR "errno"is set accordingly.  If a request did notyet terminate, a call to .IR "aio_error"returns .B "EINPROGRESS".  Ifthe value is different, the request is finished and the error value (or.IR 0) is returned and the result of the operation can be retrievedusing .IR "aio_return"..SH ERRORSPossible values for .IR "errno"are:.TP.B EAGAINThe resources necessary to queue all the requests are not available atthe moment.  The error status for each element of .IR "list"must bechecked to determine which request failed.Another reason could be that the system wide limit of AIO requests isexceeded.  This cannot be the case for the implementation on GNU systemssince no arbitrary limits exist..TP.B EINVALThe .IR "mode"parameter is invalid or .IR "nent"is larger than.B "AIO_LISTIO_MAX"..TP.B EIOOne or more of the request's I/O operations failed.  The error status ofeach request should be checked to determine which one failed..TP.B ENOSYSThe .IR "lio_listio"function is not supported..PPIf the .IR "mode"parameter is .B "LIO_NOWAIT"and the caller cancelsa request, the error status for this request returned by.IR "aio_error"is .B "ECANCELED"..SH "SEE ALSO".BR aio(3),.BR aio_cancel(3),.BR aio_cancel64(3),.BR aio_error(3),.BR aio_error64(3),.BR aio_fsync(3),.BR aio_fsync64(3),.BR aio_init(3),.BR aio_read(3),.BR aio_read64(3),.BR aio_return(3),.BR aio_return64(3),.BR aio_suspend(3),.BR aio_suspend64(3),.BR aio_write(3),.BR aio_write64(3)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -