Check input buffer in C

Alan S. Mazer alan at george.Jpl.Nasa.Gov
Wed May 30 06:06:00 AEST 1990


In article <1990May26.144958.4395 at aucs.uucp>, 852028e at aucs.uucp (Amari  M.  Elammari) writes:
>  Is there a UNIX C (sun4 C) function that checks if the input buffer 
>  is empty???

Under 4.2 there was an FIONREAD ioctl -- not sure if this is still available.
That returned the number of characters waiting to be read.  You can also
use select() to find out if something is there.

-- Alan				# "But seriously, what could go wrong?"
   ..!ames!elroy!alan
   alan at elroy.jpl.nasa.gov



More information about the Comp.unix.questions mailing list