Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!gatech!akgua!whuxlm!whuxl!houxm!hropus!ka From: ka@hropus.UUCP (Kenneth Almquist) Newsgroups: net.unix-wizards Subject: Re: tty w/wo modem control inquiry Message-ID: <418@hropus.UUCP> Date: Wed, 16-Apr-86 13:10:53 EST Article-I.D.: hropus.418 Posted: Wed Apr 16 13:10:53 1986 Date-Received: Sun, 20-Apr-86 17:06:24 EST References: <979@rlgvax.UUCP> <350@ptsfb.UUCP> Organization: Bell Labs, Holmdel, NJ Lines: 28 Furthermore, my experience on one system is that with modem control, if DCD is dropped after the open, and read(2)s or write(2)s to the port will block until DCD is restored. In SysV, read is supposed to return zero after carrier is dropped, according to the termio manual page. I don't think that the manual says what write is supposed to do in this situation; the device drivers that I have experimented with all return zero when this happens (or a short count if carrier drops in the middle of a write). Maybe someone else can detail how read(2) and write(2) are *supposed* to be affected of the O_NDELAY flag. In SysV, reads on a tty should not roadblock if data is not available; they should return 0 instead. It is true that the UNIX manual says nothing about the effects of the O_NDELAY flag on writes to a tty; I believe that this om- ission was an intentional one, indicating that the O_NDELAY flag should have no effect on writes to a tty. The preceding paragraph applies only to System V. 4.2 BSD also has no delay I/O, but under BSD read returns an error indication rather than zero to in- dicate that no data is available. I believe that the Berkeley approach is better (since it avoids the confusion between "no data available" and "end of file"), but it does mean that System V and BSD are incompatible in this area. Kenneth Almquist ihnp4!houxm!hropus!ka (official name) ihnp4!opus!ka (shorter path)