Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/12/84; site nbs-amrf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!umcp-cs!nbs-amrf!libes From: libes@nbs-amrf.UUCP (Don Libes) Newsgroups: net.unix-wizards Subject: asynchronous timed I/O. How? Message-ID: <34@nbs-amrf.UUCP> Date: Sat, 19-Oct-85 23:06:22 EDT Article-I.D.: nbs-amrf.34 Posted: Sat Oct 19 23:06:22 1985 Date-Received: Tue, 22-Oct-85 06:22:58 EDT Distribution: net Organization: National Bureau of Standards Lines: 21 I am familiar with asynchronous i/o via fcntl() & SIGIO and timed i/o via timers & alarms. Is it possible to get both at the same time (on 4. 2)? I have a need for something like: /* fd is non-blocking */ timed_read(fd,buffer,length,timeout) The only possibility (short of interrupting on every char - is that really feasible?) I've considered is setting a timer and when it goes off, checking via FIONCTL when the i/o would complete or not. But this means that all my reads will always take the max time allowed. Any suggestions? Also (if you've gotten this far), I need to catch an interrupt when timeout occurs OR the read completes (and set a status). So my final version would look like: timed_read(fd,buffer,length,timeout,&status,function) Don Libes {seismo,umcp-cs}!nbs-amrf!libes