aiocb(5) aiocb(5)
NAME
aiocb - Asynchronous I/O Control Block
SYNOPSIS
cc [options] -D_REENTRANT file -lthread
#include <aio.h>
DESCRIPTION
aiocb specifies the asynchronous I/O control block that is
used by the asynchronous I/O interface routines.
The asynchronous I/O routines pass information with the
request and receive completion status information after the
I/O operation has completed. An asynchronous I/O control
block structure aiocb is used to specify input parameters and
receive completion status information for asynchronous I/O
requests. This structure is defined in aio.h and includes the
following members:
int aio_fildes; /* file descriptor */
volatile void *aio_buf; /* buffer location */
size_t aio_nbytes; /* length of transfer */
off_t aio_offset; /* file offset */
int aio_reqprio; /* request priority offset */
struct sigevent aio_sigevent; /* signal number and offset */
int aio_lio_opcode; /* listio operation */
int aio_flags; /* flags */
The structure members aio_fildes, aio_buf, and aio_nbytes are
the same as the fildes, buf, and nbytes arguments to read and
write. With aio_read, for example, the caller wishes to read
aio_nbytes from the file associated with aio_fildes into the
buffer pointed to by aio_buf. All appropriate structure
members should be set by the caller when aio_read or aio_write
is called.
The aio_sigevent member defines the notification method to be
used on I/O completion. If aio_sigevent.sigev_notify is
SIGEV_NONE, no notification is posted on I/O completion, but
the error status for the operation and the return status for
the operation shall be appropriately set.
You may set the AIO_RAW flag bit in the aio_flags structure
member when the asynchronous I/O is being done to a raw device
partition. When the AIO_RAW flag bit is set, asynchronous I/O
might possibly be more efficient. Since asynchronous I/O is
Copyright 1994 Novell, Inc. Page 1
aiocb(5) aiocb(5)
restricted to raw device partitions on SVR4.2, asynchronous
I/O always behaves as if AIO_RAW was set. On SVR4.2, setting
the AIO_RAW flag bit is required. If it is not set, all
requests, such as aio_read and aio_write should return -1 and
set errno to EINVAL.
To insure forward compatibility, you must set all unused
fields of the aiocb structure to zero. This can be done by
using calloc [see malloc(3C)] to allocate the structure. The
aio_reqprio and aio_lio_opcode fields should be set to zero
for applications developed under SVR4.2.
REFERENCES
aio_cancel(3aio), aio_error(3aio), aio_read(3aio),
aio_suspend(3aio), aio_write(3aio), malloc(3C), read(2),
write(2)
NOTICES
This page is derived from IEEE Draft Standard P1003.4/D14.
See copyright page for further information.
Copyright 1994 Novell, Inc. Page 2