libes@nbs-amrf.UUCP (Don Libes) (10/20/85)
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