aio_read2() and aio_write2()

From: Alan Somers <asomers_at_freebsd.org>
Date: Sat, 13 Jan 2024 22:18:41 UTC
I'm not on this mailing list, but I saw kib's code review and I have
some comments

> Can we have some aio_read() function that ignores aio_offset (i.e. the current file position is used)? I'm trying to port libboost's ASIO file support to FreeBSD, and I stumbled upon this limitation.

The fundamental problem with using the file's seek offset with AIO is
that multiple operations may be in-flight at any one time that depend
on the seek offset, and there's nothing that enforces their ordering.
Whether you use aio_read2 as you suggested, or lio_listio as kib
suggested, as soon as you submit a second operation before the first
one completes the results become undefined.  That's why no existing
AIO operations involve the seek pointer in any way.

How does boost.asio address this problem?  Are its operations
completed in a strict sequence?

-Alan