Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site nbc1.UUCP Path: utzoo!linus!philabs!nbc1!abs From: abs@nbc1.UUCP (Andrew Siegel) Newsgroups: net.wanted.sources,net.unix-wizards Subject: How do I arrange for I/O calls to tty's to timeout? Message-ID: <117@nbc1.UUCP> Date: Tue, 15-Oct-85 21:28:37 EDT Article-I.D.: nbc1.117 Posted: Tue Oct 15 21:28:37 1985 Date-Received: Thu, 17-Oct-85 07:27:24 EDT Distribution: net Organization: NBC Computer Imaging, New York, NY Lines: 23 Xref: linus net.wanted.sources:1422 net.unix-wizards:12431 I'm looking for an elegant way to achieve "timeout-able" data reads from tty's (and sockets, if possible). In other words, to have a call like: c = getc_timed(stream,delay); which would return some kind of recognizable code should the character not be read from the specified stream within the specified delay. (I'd also like some kind of distinct returned value for EOF.) I've done this in both System III and 4.2BSD (using two different methods, both involving use of the SIGALRM signal), but I'd like to know if I'm overlooking some more obvious facility in UNIX. A transportable method would be the best. Can anyone point me in the right direction, or (even better) send me an example of the method you use? Thanks. Andy Siegel NBC Computer Imaging philabs!nbc1!abs