[RFC] [PATCH] Make lio_listio set errno to EIO on requests with invalid aio_lio_opcode
Roland McGrath
roland@redhat.com
Mon Feb 27 19:47:00 GMT 2006
> So the following doesn't apply? I know it's rationale, but it directs as to
> the proper use of EIO....
I read that rationale as explaining why lio_listio itself does not return
EINVAL or EBADF in such a case, as one might naively expect. It is an
unusual part of the interface that EIO means the call filled in a buffer
with results for you to look at. The normative text clearly explains the
EIO behavior to diagnose errors detected at the time of the lio_listio
call, without giving any requirement that any errors are necessarily
diagnosed then. I don't think the example in the rationale is intended to
suggest that these particular errors are necessarily diagnosed at the time
of the call.
> ----- quote from SUSv3 (TC2), System Interfaces, P697 lines 23139-23147 ----
> Although it may appear that there are inconsistencies in the specified
> circumstances for error codes, the [EIO] error condition applies when any
> circumstance relating to an individual operation makes that operation fail.
> This might be due to a badly formulated request (for example, the
> aio_lio_opcode field is invalid, and aio_error ( ) returns [EINVAL]) or
> might arise from application behavior (for example, the file descriptor is
> closed before the operation is initiated, and aio_error ( ) returns [EBADF]).
Thanks,
Roland
More information about the Libc-alpha
mailing list