Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!security!genrad!mit-eddie!mit-vax!eagle!harpo!seismo!hao!hplabs!sri-unix!cosell@bbn-unix From: cosell%bbn-unix@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: Non-blocking input from a tty Message-ID: <14374@sri-arpa.UUCP> Date: Tue, 6-Dec-83 20:22:55 EST Article-I.D.: sri-arpa.14374 Posted: Tue Dec 6 20:22:55 1983 Date-Received: Sat, 10-Dec-83 02:28:22 EST Lines: 24 From: Bernie Cosell Can anyone remind if there is a way (however clunky) to do a non-blocking read from a tty that is pretty portable? I thought that there was some magic I could do with pipes and signals, but I can't see a way to make it work. Here's the scenario for the general case I'm interested in: to be able to read and write from one terminal while be able to "respond" to a character typed on another terminal; no characters must ever get lost. The specific case I'm working on uses just one terminal: I am using a funny (non ^s/^q) flow control and so have to handle my own. No real problem but I can't figure out how to check if the terminal has said "stop" while I am in a loop pumping output to it. I had another peculiar query: did the folks who wrote stdio do so carefully enough that they will never lose any characters if a signal goes off while stdio is doing one of its reads or writes? Again, I am trying to be very very clean about not losing any I/ or /O and it occurred to me that if the stdio-writers were not careful enough even using the clock could do you in. Thanks /Bernie (cosell@bbn-unix)