#724: tee complains if used in a process started by ghc
-------------------------------+--------------------------------------------
    Reporter:  guest           |        Owner:                  
        Type:  bug             |       Status:  closed          
    Priority:  high            |    Milestone:  6.6.2           
   Component:  libraries/base  |      Version:  6.4.1           
    Severity:  normal          |   Resolution:  fixed           
    Keywords:                  |   Difficulty:  Moderate (1 day)
          Os:  Unknown         |     Testcase:  concio001       
Architecture:  Unknown         |  
-------------------------------+--------------------------------------------
Changes (by simonmar):

  * resolution:  => fixed
  * testcase:  => concio001
  * status:  new => closed

Comment:

 Fixed, more or less.

 {{{
 Mon May  7 05:35:37 PDT 2007  Simon Marlow <[EMAIL PROTECTED]>
   * FIX: #724 (tee complains if used in a process started by ghc)

   Now, we only set O_NONBLOCK on file descriptors that we create
   ourselves.  File descriptors that we inherit (stdin, stdout, stderr)
   are kept in blocking mode.  The way we deal with this differs between
   the threaded and non-threaded runtimes:

    - with -threaded, we just make a safe foreign call to read(), which
      may block, but this is ok.

    - without -threaded, we test the descriptor with select() before
      attempting any I/O.  This isn't completely safe - someone else
      might read the data between the select() and the read() - but it's
      a reasonable compromise and doesn't seem to measurably affect
      performance.
 }}}

 test cases to follow.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/724>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to