to interrupt on i/o operations you send a note to the process. for ioproc(2), here is iointerrupt() that does that. for timeouts here is a alarm() function (see sleep(2)) that will fire a note on you when the alarm expires. notes should also work for rendezvous()/alt(), but a better way is to include a timeout/cancel channel in your alt() operation. as a example see /sys/src/cmd/rio/time.c. here we have a central timer process that does a sleep and sends a message to channels associated with timers when they expire.
-- cinap
--- Begin Message ---I'm porting some Unix applications which implement a timeout on read/write/accept/... calls using select(). In previous versions I did the same by signals but with problems due to the behaviour of the interrupted system call. Select() is also used to choose among channels waiting for I/O. How can I implement channel selection and secure timeouts without using APE ? Re-write some pieces is not a problem, I prefer a "pure" 8c implementation. adriano
--- End Message ---