Skip to contentSkip to conversation

Should nonblocking I/O calls to a disconnected device get an error? [was: Problem: hiddev stops sending events after some error recoveries]

DISCUSSION Alan Stern 1 participant 1 message Feb 1, 2008 1 message not in the archive

lore
Share & tools
lore

Alan Stern

author
#1 lore raw
In reply to a message not in the archive
Quoted 8 lines · Salvador Eduardo Tropea

Now, I tried unplugging the device while executing a NONBLOCKing program. I didn't get any I/O error. It means I was wrong about the difference between unplugging the device and the effect of a recovery like the one I mentioned previously. You are right, but IMHO that's odd, the device should also inform I/O error when reading using a NONBLOCKing file handler. Currently a program must use blocking reads in order to get notified about the problem. It looks bad and lacks consistency. What do you think?

I don't know. Other people have debated this issue in the past, but I can't remember what the final decision was or the reasons for it.

Alan Stern