flushing input buffer

house ron s64421 at zeus.usq.EDU.AU
Wed May 1 23:43:49 AEST 1991


enag at ifi.uio.no (Erik Naggum) writes:

>Under UNIX systems, you can issue an I/O control request to flush
>input and output buffers in the operating system.  These are very much
>different from I/O buffers in the program.

>The appropriate I/O control for the UNIX system I'm sitting at right
>now is

>	ioctl (fd, TCFLSH, TCIFLUSH);

>Don't think that this is what's good for your system.  Look up the
>manual page for ioctl(2), follow the reference to what looks like the
>terminal device (termio(4)), and look for the word "flush".  If you're
>unfamiliar with ioctl's, read the entire ioctl man-page, and then read
>all of the termio man-page, even if you don't (think you) need it
>right now.

I had occasion to do this under Unix.  As far as I could tell, these
ioctl calls are not reliable.  I don't have the details handy, though.

--
Regards,

Ron House.   (s64421 at zeus.usq.edu.au)
(By post: Info Tech, U.C.S.Q. Toowoomba. Australia. 4350)



More information about the Comp.lang.c mailing list