Fully handle size_t values in AIO requests.
First, update the return types of aio_return() and aio_waitcomplete() to
ssize_t.
POSIX requires aio_return() to return a ssize_t so that it can represent
all return values from read() and write(). aio_waitcomplete() should use
ssize_t for the same reason.
aio_return() has used ssize_t in <aio.h> since r31620 but the manpage and
system call entry were not updated. aio_waitcomplete() has always
returned int.
Note that this does not require new system call stubs as this is
effectively only an API change in how the compiler interprets the return
value. The system calls have always returned a full register.
Second, allow aio_nbytes values up to SSIZE_MAX instead of just INT_MAX.
Additional thoughts:
In theory the second change should require compat versions of all the system
calls that accept an aiocb since aio_waitcomplete() can now return a
value > INT_MAX. This check made the aio_waitcomplete() return type
change a no-op, but with it updated it is in theory no longer one.
Given that aio_return() has been correct since 1997 and that
aio_waitcomplete() is FreeBSD-specific and not in POSIX, I'd probably
vote to just permit this particular ABI breakage vs the cost of adding
wrappers for several aio system calls. Hopefully any old binaries that
are using aio_waitcomplete() aren't relying on aio_read/write to fail
if aio_nbytes is above INT_MAX. (The old binaries I can think of are
i386 for which this doesn't matter.)