The Basic API
The two core functions of the AIO API are aio_read(2) and aio_write(2). These are analogous to the standard read(2) and write(2) functions. Of the two, aio_read(2) is more interesting. In a modern operating system, most writes will copy the data into a buffer and then write it to the physical disk later. This means that write(2) calls are partially asynchronous anyway.
An AIO operation happens in two parts. The first sends a request to perform the operation. The second waits for the operation to complete. The aio_suspend(2) function is used to wait for an I/O operation to complete. Once this returns, aio_return(2) is used to retrieve the return value.