select(List, timeout, Ready_stream)

Select  blocks  for  at  most  timeout milli seconds until one of the input
streams  contained in List are ready for reading.The stream, closest to the
front  of  the  list,  that has been found to be ready is then unified with
Ready_stream.    If  no  stream  was  ready,  the  call  fails.   To  block
indefinitely  timeout  may  be  set  equal to -1.  Note that this predicate
avoids busy waiting.

(Unfortunately this is not available on Sys V Unix)
(Or  AmigaDOS.  At  least  I  don't remember writing any special support to
enable this feature :-)
