Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn) Newsgroups: comp.unix.questions Subject: Re: Check input buffer in C Message-ID: <13006@smoke.BRL.MIL> Date: 27 May 90 04:48:50 GMT References: <1990May26.144958.4395@aucs.uucp> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 15 In article <1990May26.144958.4395@aucs.uucp> 852028e@aucs.UUCP (Amari M. Elammari) writes: > Is there a UNIX C (sun4 C) function that checks if the input buffer > is empty??? >What I want to do is to check the buffer, if there are some >characters in the buffer then read them; otherwise continue >with the next statement. To which "input buffer" do you refer? There are several different kinds of "input buffer" possible for a UNIX C program. If your program maintains its own buffer, it should be able to test it; the stdio buffer is not worth testing, because of the way stdio uses it; kernel disk block buffers are also not worth testing; streams can be tested with select() or poll(); under some circumstances the terminal handler MIN & TIME parameters might be appropriate.