PipeStream.st
changeset 1663 dd111ec142da
parent 1662 ce26ca3d837c
child 1984 153ce9f56b05
equal deleted inserted replaced
1662:ce26ca3d837c 1663:dd111ec142da
    39 /*
    39 /*
    40  * on some systems errno is a macro ... check for it here
    40  * on some systems errno is a macro ... check for it here
    41  */
    41  */
    42 #ifndef errno
    42 #ifndef errno
    43  extern errno;
    43  extern errno;
       
    44 #endif
       
    45 
       
    46 #ifdef LINUX
       
    47 # define BUGGY_STDIO_LIB
    44 #endif
    48 #endif
    45 
    49 
    46 %}
    50 %}
    47 ! !
    51 ! !
    48 
    52 
   173            'after write' printNewline.
   177            'after write' printNewline.
   174             p close.
   178             p close.
   175            'after close' printNewline
   179            'after close' printNewline
   176         ]
   180         ]
   177 
   181 
   178     Notice, that if the Stream is buffered, the Signal may occur some time after
   182     Notice, that iff the Stream is buffered, the Signal may occur some time after
   179     the write - or even at close time; to avoid a recursive signal in the exception
   183     the write - or even at close time; to avoid a recursive signal in the exception
   180     handler, a shutDown is useful there.
   184     handler, a shutDown is useful there.
   181 
   185 
   182     Buffered pipes do not work with Linux - the stdio library seems to be
   186     Buffered pipes do not work with Linux - the stdio library seems to be
   183     buggy (trying to restart the read ...)
   187     buggy (trying to restart the read ...)
   413         OperatingSystem unblockInterrupts
   417         OperatingSystem unblockInterrupts
   414     ].
   418     ].
   415 
   419 
   416     lastErrorNumber isNil ifTrue:[
   420     lastErrorNumber isNil ifTrue:[
   417         commandString := aCommandString.
   421         commandString := aCommandString.
   418         buffered := true.
       
   419 %{
   422 %{
   420 	/* LINUX stdio is corrupt here ... */
   423 	/* LINUX stdio is corrupt here ... */
   421 #ifdef LINUX
   424 #ifdef BUGGY_STDIO_LIB
   422 	__INST(buffered) = false;
   425 	__INST(buffered) = false;
       
   426 #else
       
   427 	__INST(buffered) = true;
   423 #endif
   428 #endif
   424 %}.
   429 %}.
   425         hitEOF := false.
   430         hitEOF := false.
   426         binary := false.
   431         binary := false.
   427         Lobby register:self
   432         Lobby register:self
   454 ! !
   459 ! !
   455 
   460 
   456 !PipeStream  class methodsFor:'documentation'!
   461 !PipeStream  class methodsFor:'documentation'!
   457 
   462 
   458 version
   463 version
   459     ^ '$Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.45 1996-09-12 15:47:23 cg Exp $'
   464     ^ '$Header: /cvs/stx/stx/libbasic/PipeStream.st,v 1.46 1996-09-12 16:09:16 cg Exp $'
   460 ! !
   465 ! !
   461 PipeStream initialize!
   466 PipeStream initialize!