On Mon, Oct 25, 2010 at 1:59 PM, Cyril Hrubis <[email protected]> wrote:
> Hi!
> I've been reading POSIX documentation for some time now and even reading
> glibc source code and the result is that aio_error/3-1.c doesn't test
> anyting and should be removed.
>
> The test is trying to assert EINVAL from aio_error accordingly to:
>
> http://www.opengroup.org/onlinepubs/009695399/functions/aio_error.html
>
> ...
>
> The aio_error() function may fail if:
>
> [EINVAL]
> The aiocbp argument does not refer to an asynchronous
> operation whose return status has not yet been retrieved.
>
> ...
>
>
> As far as I understand this, it's says you may get EINVAL if you call
> aio_error() on finished aiocb second (and more) times.
>
> This is implemented on linux as "return aiocb->__error_code" so IMHO
> there is no way to test this.
I think that the original developers misinterpreted the test
requirements. aio_error is _always_ supposed to return errno values,
not -1 and set the global errno. Otherwise it wouldn't make sense
because asynchronous I/O would be more synchronous than anything else.
I've committed a change and I'll test it out on my Linux VM once I
get a chance (unfortunately I don't have network access right now
beyond my FreeBSD machine). If things look ok, then I'll look at
correcting the rest of the aio_error testcases.
Thanks,
-Garrett
------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list