AIO(4)

NAME
aio - asynchronous I/O

SYNOPSIS
To link into the kernel:
options VFS_AIO

To load as a kernel loadable module:
    kldload aio

DESCRIPTION
The aio facility provides system calls for asynchronous I/O. It is available both as a kernel option for static inclusion and as a dynamic kernel module.

Asynchronous I/O control buffers should be zeroed before initializing individual fields. This ensures all fields are initialized.

All asynchronous I/O control buffers contain a sigevent structure in the aio_sigevent field which can be used to request notification when an operation completes.

For SIGEV_KEVENT notifications, the sigevent' s sigev_notify_kqueue field should contain the descriptor of the kqueue that the event should be attached to, its sigev_notify_kevent_flags field may contain EV_ONESHOT, EV_CLEAR, and/or EV_DISPATCH, and its sigev_notify field should be set to SIGEV_KEVENT. The posted kevent will contain:
Member | Value
ident | asynchronous I/O control buffer pointer
filter | EVFILT_AIO
flags | EV_EOF
udata |
value stored in aio_sigevent.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 sigevent.sigev_value in the si_value field.

For SIGEV_THREAD notifications, the value stored in aio_sigevent.sigev_value is passed to the aio_sigevent.sigev_notify_function as described in sigevent(3).

SEE ALSO
aio_cancel(2), aio_error(2), aio_read(2), aio_return(2), aio_suspend(2), aio_waitcomplete(2), aio_write(2), lio_listio(2), sigevent(3), config(8), kldload(8), kldunload(8)

HISTORY
The aio facility appeared as a kernel option in FreeBSD 3.0. The aio kernel module appeared in FreeBSD 5.0.