#4248: Poor error message when openFile fails to open named pipe
---------------------------------+------------------------------------------
    Reporter:  Khudyakov         |        Owner:              
        Type:  bug               |       Status:  new         
    Priority:  normal            |    Milestone:  7.0.2       
   Component:  libraries/base    |      Version:  6.12.3      
    Keywords:                    |     Testcase:              
   Blockedby:                    |   Difficulty:              
          Os:  Unknown/Multiple  |     Blocking:              
Architecture:  Unknown/Multiple  |      Failure:  None/Unknown
---------------------------------+------------------------------------------

Comment(by duncan):

 Replying to [comment:2 simonmar]:
 > Would you like us to try opening the file in blocking mode if non-
 blocking mode fails?

 I don't think we would want to do that in general for all files, it's hard
 to predict what that does for security or atomicity properties.

 The linux man page makes the behaviour clear:
 {{{
 A process can open a FIFO in nonblocking mode.  In this  case,  opening
 for  read only will succeed even if no-one has opened on the write side
 yet, opening for write only will fail with ENXIO  (no  such  device  or
 address) unless the other end has already been opened.

 Under  Linux,  opening  a  FIFO for read and write will succeed both in
 blocking and nonblocking mode.  POSIX leaves this  behavior  undefined.
 This  can be used to open a FIFO for writing while there are no readers
 available.  A process that uses both ends of the connection in order to
 communicate with itself should be very careful to avoid deadlocks.
 }}}

 So, the "does not exist" error is a direct consequence of the `ENXIO`
 error code "no  such  device or address".

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4248#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to