Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!drockwel@bbn-vax
From: drockwel@bbn-vax@sri-unix.UUCP
Newsgroups: net.unix-wizards
Subject: Re: how do you time-out on a read?
Message-ID: <3381@sri-arpa.UUCP>
Date: Sat, 23-Jul-83 08:48:00 EDT
Article-I.D.: sri-arpa.3381
Posted: Sat Jul 23 08:48:00 1983
Date-Received: Mon, 25-Jul-83 04:28:10 EDT
Lines: 6

From:  Dennis Rockwell 

The simplest way to timeout a read is to use the alarm(II) system call.
This will send your process a signal (SIGALRM) after n seconds.  The
read will terminate with an error (EINTR), and the routine which
catches the signal can set a flag to be tested when the read does so.