Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site mcgill-vision.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: net.unix-wizards,net.unix,net.wanted Subject: Re: Need Non-Blocking Terminal Input Function For Berkeley 4.2 Message-ID: <358@mcgill-vision.UUCP> Date: Mon, 27-Jan-86 18:18:35 EST Article-I.D.: mcgill-v.358 Posted: Mon Jan 27 18:18:35 1986 Date-Received: Sat, 1-Feb-86 00:45:20 EST References: <482@kontron.UUCP>, <132@wgivax.UUCP> Organization: McGill University, Montreal Lines: 19 Xref: watmath net.unix-wizards:16591 net.unix:6968 net.wanted:8039 I missed the original, but what's wrong with using the non-blocking mode already provided by the kernel? int on = 1; ioctl(fd,FIONBIO,&on); then if you read() and there are no data available, the read will return with either EOF or error (return value <= 0) and errno will be EWOULDBLOCK. -- der Mouse USA: {ihnp4,decvax,akgua,etc}!utcsri!mcgill-vision!mouse philabs!micomvax!musocs!mcgill-vision!mouse Europe: mcvax!decvax!utcsri!mcgill-vision!mouse mcvax!seismo!cmcl2!philabs!micomvax!musocs!mcgill-vision!mouse Hacker: One who accidentally destroys / Wizard: One who recovers it afterward