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

Oron Peled oron at actcom.co.il
Mon Jun 27 22:35:29 MSD 2011

On Monday, 27 בJune 2011 11:31:48 Eli Billauer wrote:
> Shachar Shemesh wrote:
> > Nobody expects ENODEV on an already opened device. I'd go for EIO, 
> > myself.
> And so shall I. Thanks.
> ...
> And the truth is that I don't care about recovering from such an error. 

Another strategy is to throw SIGPIPE at the relevant processes:
 * Con: it is usually expected upon write(2) not read(2) et-al.

 * Pros:
   - At least for write(2) the semantics is natural -- no more writes
     on this file descriptor.

   - Kills the offending process by default.

   - Process may catch it in a signal handler (easy to write some
     global cleanup + exit code)


Oron Peled                                 Voice: +972-4-8228492
oron at actcom.co.il                  http://users.actcom.co.il/~oron
Lottery: A tax on people who are bad at math.

More information about the Haifux mailing list