Re: how to flush stdin buffer in linux

2013-01-09 Thread richard -rw- weinberger
On Wed, Jan 9, 2013 at 10:20 AM, beyond.hack wrote: > you may try with > __fpurge() >From the manpage: NOTES Usually it is a mistake to want to discard input buffers. -- Thanks, //richard ___ Kernelnewbies mailing list Kernelnewbies@kernelnewb

Re: how to flush stdin buffer in linux

2013-01-09 Thread beyond.hack
you may try with __fpurge() On Wed, Jan 9, 2013 at 1:23 AM, Tobias Boege 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 > It > > didn't clear my buffer so I am wondering how can I clear the stdin buffe

Re: how to flush stdin buffer in linux

2013-01-08 Thread Tobias Boege
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 It > 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 > operat

Re: how to flush stdin buffer in linux

2013-01-08 Thread richard -rw- weinberger
On Tue, Jan 8, 2013 at 6:20 PM, Niroj Pokhrel wrote: > Hi all, > I tried to use fflush(stdin) in gcc as I used to in other compilers. But It > 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 ls

how to flush stdin buffer in linux

2013-01-08 Thread Niroj Pokhrel
Hi all, I tried to use fflush(stdin) in gcc as I used to in other compilers. But It 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. __