A newer version of this document is available. Customers should click here to go to the newest version.
lio_listio
Performs an asynchronous read operation.
Syntax
int lio_listio(int mode, struct aiocb *list[], int nent, struct sigevent *sig);  |  
     
Arguments
mode  |  
      Takes following values declared in <aio.h> file: 
  |  
     
*list[]  |  
      Array of the aiocb pointers specifying the submitted I/O requests; NULL elements in the array are ignored  |  
     
nent  |  
      Number of elements in the array  |  
     
*sig  |  
      Determines if asynchronous notification is sent after all I/O operations completes; takes following values: 
  |  
     
Description
The lio_listio() function initiates a list of I/O requests with a single function call.
The mode argument determines whether the function returns when all the I/O operations are completed, or as soon as the operations are queued.
If the mode argument is LIO_WAIT, the function waits until all I/O operations are complete. The sig argument is ignored in this case.
If the mode argument is LIO_NOWAIT, the function returns immediately. Asynchronous notification occurs according to the sig argument after all the I/O operations complete.
Returns
When mode=LIO_NOWAIT the lio_listio() function returns:
- 0: I/O operations are successfully queued
 - -1: Error; I/O operations not queued; to get the proper error code, use errno.
 
When mode=LIO_WAIT the lio_listio() function returns:
- 0: I/O operations specified completed successfully
 - -1: Error; I/O operations not completed; to get the proper error code, use errno.