Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: input ready under UNIX ??!!?? Message-ID: <364@auspex.UUCP> Date: 31 Oct 88 20:08:13 GMT Article-I.D.: auspex.364 References: <771@necis.UUCP> <547@poseidon.ATT.COM> <320@auspex.UUCP> <6851@chinet.chi.il.us> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 17 >>>(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.)