[Haifux] Telling the kernel business is closed (my weekly riddle)

Nadav Har'El nyh at math.technion.ac.il
Tue Jun 28 20:54:20 MSD 2011


On Mon, Jun 27, 2011, Eli Billauer wrote about "[Haifux] Telling the kernel business is closed (my weekly riddle)":
> invocation of read(), write(), and other relevant methods. Maybe also 
> before returning a successful value. If the flag is set ( = problem 
> detected) return some -EDROPDEAD, so that application software reacts, 
> and maybe someone will go to /var/log/messages to get a better idea of 
> what happened. (I think I'll settle for -ENODEV)

ENODEV makes sense for open(2), but not for read(2), write(2) or ioctl(2).

For read(2) or write(2), I'd use EIO. For ioctl(2), I don't know what to use -
the manual page doesn't list EIO; Perhaps your ioctl(2) can return the failure
announcement as part of its normal return value, and don't fail the actual
ioctl?

-- 
Nadav Har'El                        |      Tuesday, Jun 28 2011, 27 Sivan 5771
nyh at math.technion.ac.il             |-----------------------------------------
Phone +972-523-790466, ICQ 13349191 |Cat rule #2: Bite the hand that won't
http://nadav.harel.org.il           |feed you fast enough.



More information about the Haifux mailing list