how to flush stdin buffer in linux
beyond.hack at gmail.com
Wed Jan 9 04:20:20 EST 2013
you may try with
On Wed, Jan 9, 2013 at 1:23 AM, Tobias Boege <tobias at gambas-buch.de> wrote:
> On Tue, 08 Jan 2013, Niroj Pokhrel wrote:
> > Hi all,
> > I tried to use fflush(stdin) in gcc as I used to in other compilers. But
> > didn't clear my buffer so I am wondering how can I clear the stdin buffer
> > in GCC.
> > I tried using lseek but got -EPIPE (as tty devices doesn't support lseek
> > operation).
> > Thanx in advance.
> If it's a tty, you may want to use tcflush(fd, TCIFLUSH);
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies