aio --
data definitions for asynchronous input and output
Description
Asynchronous I/O control block
An asynchronous I/O control block structure
aiocb is used in many
of the asynchronous I/O function interfaces.
It is defined in <aio.h> and has the following members:
Member type
Member name
Description
int
aio_fildes
File descriptor
off_t
aio_offset
File offset
volatile void*
aio_buf
Location of buffer
size_t
aio_nbytes
Length of transfer
int
aio_reqprio
Request priority offset
struct sigevent
aio_sigevent
Signal number and value
int
aio_lio_opcode
Operation to be performed
aiocb structures as used by applications must reside in
memory specified by the
aio_mkcbs(S)
function.
The aio_fildes element is the file descriptor on which the
asynchronous operation is to be performed. This is defined for raw
(character) devices only.
If O_APPEND is not set for the file descriptor
aio_fildes, and if aio_fildes is associated with
a device that is capable of seeking, then the requested operation
takes place at the absolute position in the file as given by
aio_offset, as if
lseek(S)
were called immediately prior to the operation with an
offset argument equal to aio_offset, and a
whence argument equal to SEEK_SET. If
O_APPEND is set for the file descriptor, or if
aio_fildes is associated with a device that is incapable
of seeking, write operations append to the file in the same order as
the calls were made.
Independently of how aio_sigevent is initialized, no
signals are delivered.
The aio_lio_opcode field is used only by the
lio_listio( )
call. The lio_listio call allows multiple asynchronous
I/O operations to be submitted at a single time. The
function takes as an argument an array of pointers to
aiocb structures. Each aiocb structure indicates
the operation to be performed (read or write) via the
aio_lio_opcode field.
The address of the aiocb structure is used as a handle for
retrieving the error status and return status of the asynchronous
operation while it is in progress.
The aiocb structure and the data buffers associated with
the asynchronous I/O operation are being used by the
system for asynchronous I/O while, and only while, the
error status of the asynchronous operation is equal to
[EINPROGRESS]. Applications must not modify the
aiocb structure while the structure is being used by the
system for asynchronous I/O.
The return status of the asynchronous operation is the number of
bytes transferred by the I/O operation. If the error
status is set to indicate an error completion, then the return
status is set to the return value that the corresponding
read(S),
write(S),
or
fsync(S)
call would have returned. When the error status is not equal to
[EINPROGRESS], the return status shall reflect the return
status of the corresponding synchronous operation.
Manifest constants
<aio.h> defines the following symbols:
LIO_WAIT
A lio_listio synchronization option, indicating that the
calling process is to be suspended until the lio_listio
operation is complete.
LIO_NOWAlT
A lio_listio synchronization option, indicating that the
calling process is to continue execution while the
lio_listio operation is being performed, and no
notification shall be given when the operation is complete.
LIO_READ
A lio_listio element operation option, requesting a read.
LIO_WRITE
A lio_listio element operation option, requesting a write.
LIO_NOP
A lio_listio element operation option, indicating that no
transfer is requested.