Path: utzoo!yunexus!geac!syntron!jtsv16!uunet!seismo!sundc!pitstop!sun!amdcad!ames!mailrus!cwjcc!tut.cis.ohio-state.edu!osu-cis!dsacg1!dsacg3!vfm6066 From: vfm6066@dsacg3.UUCP (John A. Ebersold) Newsgroups: comp.lang.c Subject: Re: input ready under UNIX ??!!?? Keywords: input, unix, help Message-ID: <1122@dsacg3.UUCP> Date: 28 Oct 88 14:06:38 GMT Article-I.D.: dsacg3.1122 References: <771@necis.UUCP> <12430@steinmetz.ge.com> Reply-To: vfm6066@dsacg3.UUCP (John A. Ebersold) Organization: Defense Logistics Agency Systems Automation Center, Columbus Lines: 23 Several years ago, on a PDP-11 under Ultrix-11 I did basically the following: (Forgive the pigdin C :-) ). long l; fp = fopen(the tty); fd = fileno(fp); if (ioctl(fd, FIONREAD, &l) != -1) if (l > 0) printf("There are characters\n"); I believe this is a Berkeleyism - the flavor I am not sure of. There is also fcntl: fcntl(fd, FNDELAY, arg); To quote the manual: "nonblocking I/O; if no data is available to a read call, or if a write operation would block, the call returns -1 with the error EWOULDBLOCK." Also a Berkeleyism.