How can I read keyboard without stopping

Doug Gwyn gwyn at smoke.ARPA
Sat Sep 3 13:04:46 AEST 1988


In article <690 at super.ORG> rminnich at metropolis.UUCP (Ronald G Minnich) writes:
>P.S. Does it strike anyone as strange that stdio and level 2 have such
>different ideas about eof? Level 2 you can just read right through ^D; 
>As was pointed out, it is more like an enforced one-read FNDELAY than 
>anything else. for standard IO, one is enough; you lose it all right there. 
>The FILE * gets closed for you. 

If that's true, it's a bug.  EOF on a stream is not supposed to
close the stream, merely set the EOF indicator.  In fact EOF
should not be "sticky"; if more data becomes available, as on a
terminal, it should be available for subsequent reading.  The
4.2BSD implementation broke this but it might be okay on 4.3BSD.



More information about the Comp.unix.wizards mailing list