Copyright (c) 2003 Tim J. Robbins All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or oth...
NAMElio_listio - list directed I/O (REALTIME)
SYNOPSISIn aio.h Ft int Fo lio_listio Fa int mode Fa struct aiocb * const list Fa int nent Fa struct sigevent *sig Fc
DESCRIPTIONThe Fn lio_listio function initiates a list of I/O requests with a single function call. The Fa list argument is an array of pointers to Vt aiocb structures describing each operation to perform, with Fa nent elements. NULL elements are ignored.
The aio_lio_opcode field of each Vt aiocb specifies the operation to be performed. The following operations are supported:
- Read data as if by a call to aio_read2.
- No operation.
- Write data as if by a call to aio_write2.
If the Fa mode argument is LIO_WAIT Fn lio_listio does not return until all the requested operations have been completed. If Fa mode is LIO_NOWAIT Fa sig can be used to request asynchronous notification when all operations have completed. If Fa sig is NULL no notification is sent.
For SIGEV_KEVENT notifications, the posted kevent will contain:
- Member Ta Value
- ident Ta Fa list
- filter Ta EVFILT_LIO
- udata Ta value stored in
- Fa sig->sigev_value
For SIGEV_SIGNO and SIGEV_THREAD_ID notifications, the information for the queued signal will include SI_ASYNCIO in the si_code field and the value stored in Fa sig->sigev_value in the si_value field.
For SIGEV_THREAD notifications, the value stored in Fa sig->sigev_value is passed to the Fa sig->sigev_notify_function as described in sigevent(3).
The order in which the requests are carried out is not specified; in particular, there is no guarantee that they will be executed in the order 0, 1, ..., Fa nent Ns -1 .
RETURN VALUESIf Fa mode is LIO_WAIT the Fn lio_listio function returns 0 if the operations completed successfully, otherwise -1.
If Fa mode is LIO_NOWAIT the Fn lio_listio function returns 0 if the operations are successfully queued, otherwise -1.
ERRORSThe Fn lio_listio function will fail if:
- Bq Er EAGAIN
- There are not enough resources to enqueue the requests.
- Bq Er EAGAIN
- The request would cause the system-wide limit AIO_MAX to be exceeded.
- Bq Er EINVAL
- The Fa mode argument is neither LIO_WAIT nor LIO_NOWAIT or Fa nent is greater than AIO_LISTIO_MAX
- Bq Er EINVAL
- The asynchronous notification method in Fa sig->sigev_notify is invalid or not supported.
- Bq Er EINTR
- A signal interrupted the system call before it could be completed.
- Bq Er EIO
- One or more requests failed.
In addition, the Fn lio_listio function may fail for any of the reasons listed for aio_read2 and aio_write2.
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 aio_error2.