p The .Va aio_lio_opcode field of each .Vt aiocb specifies the operation to be performed. The following operations are supported: l -tag -width ".Dv LIO_WRITE" -offset indent t Dv LIO_READ Read data as if by a call to .Xr aio_read 3 . t Dv LIO_NOP No operation. t Dv LIO_WRITE Write data as if by a call to .Xr aio_write 3 . .El
p If the .Fa mode argument is .Dv LIO_WAIT , .Fn lio_listio does not return until all the requested operations have been completed. If .Fa mode is .Dv LIO_NOWAIT , the requests are processed asynchronously, and the signal specified by .Fa sig is sent when all operations have completed. If .Fa sig is .Dv NULL , the calling process is not notified of I/O completion.
p The order in which the requests are carried out is not specified, and there is no guarantee that they will be executed sequentially. .Sh RETURN VALUES If .Fa mode is .Dv LIO_WAIT , the .Fn lio_listio function returns 0 if the operations completed successfully, otherwise -1.
p If .Fa mode is .Dv LIO_NOWAIT , the .Fn lio_listio function returns 0 if the operations are successfully queued, otherwise -1. .Sh ERRORS The .Fn lio_listio function will fail if: l -tag -width Er t Bq Er EAGAIN There are not enough resources to enqueue the requests; or the request would cause the system-wide limit .Dv AIO_MAX to be exceeded. t Bq Er EINTR A signal interrupted the system call before it could be completed. t Bq Er EINVAL The .Fa mode argument is neither .Dv LIO_WAIT nor .Dv LIO_NOWAIT , or .Fa nent is greater than .Dv AIO_LISTIO_MAX . t Bq Er EIO One or more requests failed. .El
p In addition, the .Fn lio_listio function may fail for any of the reasons listed for .Xr aio_read 3 and .Xr aio_write 3 .
p If .Fn lio_listio succeeds, or fails with an error code of .Er EAGAIN , EINTR , or .Er EIO , some of the requests may have been initiated. The caller should check the error status of each .Vt aiocb structure individually by calling .Xr aio_error 3 . .Sh SEE ALSO .Xr read 2 , .Xr siginfo 2 , .Xr write 2 , .Xr aio 3 , .Xr sigevent 3 .Sh STANDARDS The .Fn lio_listio function is expected to conform to .St -p1003.1-2001 .