aio.5 (2010 09)

a
aio(5) aio(5)
The maximum priority change that can be specified in
aio_reqprio is limited. The maximum priority
change value is tunable. The current maximum value can be obtained using the
sysconf() call with
the argument
_SC_AIO_PRIO_DELTA_MAX.
The default value is 20.
The maximum number of asynchronous I/O operations that can be specified in a single
lio_listio()
call is limited. This limit is tunable. The current maximum value can be obtained using the
sysconf()
call with the argument _SC_AIO_LISTIO_MAX.
The default maximum value is 256.
Some asynchronous I/O operations are also subject to both system-wide and per-process limits on the
number of simultaneously active threads. See pthread (3T).
Programming Limitations and Restrictions
Altering the contents of or deallocating memory associated with the
aiocb referred to by aiocbp or the
buffer referred to by
aiocbp->aio_buf
while an asynchronous read operation is outstanding, that is
aio_return() has not been called for the aiocb
, may produce unpredictable results.
EXAMPLES
The following code sequence illustrates an asynchronous read operation and polling for completion.
#include <fcntl.h>
#include <errno.h>
#include <aio.h>
char buf[4096];
int retval;
struct aiocb myaiocb;
bzero( &myaiocb, sizeof (struct aiocb));
myaiocb.aio_fildes = open( "/dev/null", O_RDONLY);
myaiocb.aio_offset = 0;
myaiocb.aio_buf = (void *) buf;
myaiocb.aio_nbytes = sizeof (buf);
myaiocb.aio_sigevent.sigev_notify = SIGEV_NONE;
retval = aio_read( &myaiocb );
if (retval) perror("aio:");
/* continue processing */
...
/* wait for completion */
while ( (retval = aio_error( &myaiocb) ) == EINPROGRESS) ;
/* free the aiocb */
retval = aio_return( &myaiocb);
SEE ALSO
aio_cancel(2), aio_error(2), aio_fsync(2), aio_read(2), aio_return(2), aio_suspend(2), aio_write(2), fsync(2),
getrlimit(2), lio_listio(2), read(2), write(2), pthread(3T).
STANDARDS CONFORMANCE
aio: POSIX Realtime Extensions, IEEE Std 1003.1b
4 Hewlett-Packard Company 4 HP-UX 11i Version 3: September 2010