input ready under UNIX ??!!??

Guy Harris guy at auspex.UUCP
Tue Nov 1 06:08:13 AEST 1988


 >>>(1)  Using fcntl(2), set file descriptor 0 to be non-blocking (what
 >>>fcntl(5) calls O_NDELAY).  If you want line-at-a-time input, keep
 >
 >>...
 >>this means the bottom line is "'read()' will return 0 if no data has
 >>been entered yet."
 >
 >On the AT&T 3b2 SysVr3.[01] logging in through the starlan network
 >(streams based tty emulation) read() will return -1 when no data
 >is available (and O_NDELAY is set).

I guess they didn't put the fix into the streams code, which enables
streams-based ttys to be backwards-compatible with old-style ttys, in
S5R3.[01].  Now you know why they should have - it breaks programs that
properly expect 0 for "no data", like the SVID says....  (Yes, such a
fix is in SunOS; it handles both BSD-style and S5-style non-blocking I/O.)



More information about the Comp.unix.questions mailing list