Initiates a list of asynchronous I/O requests with a single call.
int lio_listio (cmd,
list, nent, eventp)
int cmd, nent;
struct liocb * list[ ];
struct event * eventp;
int lio_listio64 (cmd, list,nent, eventp) int cmd, nent; struct liocb64 *list; struct event *eventp;
The lio_listio subroutine allows the calling process to initiate the nent parameter asynchronous I/O requests. These requests are specified in the liocb structures pointed to by the elements of the list array. The call may block or return immediately depending on the cmd parameter. If the cmd parameter requests that I/O completion be asynchronously notified, a SIGIO signal is delivered when all I/O operations are completed.
The lio_listio64 subroutine is similar to the lio_listio subroutine except that it takes an array of pointers to liocb64 structures. This allows the lio_listio64 subroutine to specify offsets in excess of OFF_MAX (2 gigbytes minus 1).
In the large file enabled programming environment, lio_listio is redefined to be lio_listio64.
Note: The SIGIO signal will be replaced by real-time signals when they are available. The pointer to the event structure eventp parameter is currently not in use but is included for future compatibility.
|cmd||The cmd parameter takes one of the following values:
|list||Points to an array of pointers to liocb structures. The
structure array contains nent elements:
|nent||Specifies the number of entries in the array of pointers to listio structures.|
|eventp||Points to an event structure to be used when the cmd parameter is set to the LIO_ASYNC value. This parameter is currently ignored.|
The lio_listio and lio_listio64 subroutines can be called from the process environment only.
When the lio_listio subroutine is successful, it returns a value of 0. Otherwise, it returns a value of -1 and sets the errno global variable to identify the error. The returned value indicates the success or failure of the lio_listio subroutine itself and not of the asynchronous I/O requests (except when the command is LIO_WAIT). The aio_error subroutine returns the status of each I/O request.
Return codes can be set to the
following errno values:
|EAGAIN||Indicates that the system resources required to queue the request are not available. Specifically, the transmit queue may be full, or the maximum number of opens may have been reached.|
|EFAIL||Indicates that one or more I/O operations was not successful. This error can be received only if the cmd parameter has a LIO_WAIT value.|
|EINTR||Indicates that a signal or event interrupted the lio_listio subroutine call.|
|EINVAL||Indicates that the aio_whence field does not have a valid value or that the resulting pointer is not valid.|
The lio_listio and lio_listio64 subroutines are part of the Base Operating System (BOS) Runtime.
The aio_cancel or aio_cancel64 (aio_cancel or aio_cancel64 Subroutine) subroutine, aio_error or aio_error64 (aio_error or aio_error64 Subroutine) subroutine, aio_read or aio_read64 (aio_read or aio_read64 Subroutine) subroutine, aio_return or aio_return64 (aio_return or aio_return64 Subroutine) subroutine, aio_suspend or aio_suspend64 (aio_suspend or aio_suspend64 Subroutine) subroutine, aio_write or aio_write64 (aio_write or aio_write64 Subroutine) subroutine.
The Asynchronous I/O Overview and the Communications I/O Subsystem: Programming Introduction in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.
The Input and Output Handling Programmer's Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs describes the files, commands, and subroutines used for low-level, stream, terminal, and asynchronous I/O interfaces.