Hi!
> >The testcase passes here. However looking at the sources it tries to
> >read zero bytes to NULL buffer, which is wrong as the behavior in such
> >case is undefied by POSIX. I guess this is just another case where the
> >testcase was coded with "It works so it must be right" attitude.
> >
> >And out of curiosity, which libc library makes the testcase fail?
> Yes, aio_read() return 0, and the case fails.
> 
> In posix spec Line 19887:
> RETURN VALUE
> The aio_read( ) function shall return the value zero if the I/O
> operation is successfully queued;
> otherwise, the function shall return the value ???1 and set errno to
> indicate the error.
> 
> So when the I/O operation enqueued, aio_read() return 0, then that
> the I/O operation will be processing.
> I still doubt the case is invalid.

Well, the POSIX explicitly says that if the pointer to the buffer
becames illegal prior the I/O completion the behavior is undefined. So
strictly speaking when you pass NULL buffer to aio_read() the behavior
is undefined to begin with. At least that is how I understand the
standard.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to