Subject: Why does read() block on I/O error?
To: None <>
From: Michael Core <>
List: current-users
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.