Subject: Why does read() block on I/O error?
To: None <email@example.com>
From: Michael Core <firstname.lastname@example.org>
Date: 07/09/2002 04:28:24
I have some badly burned cd-roms. When I want to read a file from it and
set the fd to O_NONBLOCK read() does still block for a few seconds.
Shouldn't read() return something like EAGAIN instead? Of course, read()
reports the I/O error but I would prefer if it returned _immediately_
with EAGAIN or EIO. Otherwise you cannot trust O_NONBLOCK at all.
Perhaps I just don't understand O_NONBLOCK.