[MPlayer-dev-eng] PATCH: disable stdin buffer when reading from stdin

Alexander Neundorf neundorf at dellingsoft.de
Mon Apr 29 18:39:20 CEST 2002


On Monday 29 April 2002 18:05, you wrote:
> Hi,
>
> > > On Fri, Apr 26, 2002 at 04:50:36PM +0200, Arpi wrote:
> > > > 2. is it portable to all currently supported os? looks like lowlevel
> > > > tty manipulation stuff, liek in getch2.c, one of the most
> > > > difficult-to-port files
> > >
> > > According to setvbuf(3) setvbuf is in ANSI C.
> >
> > Yes, it's definitely portable. setvbuf only deals with the buffering
> > in the FILE structure used by ANSI io functions, not the POSIX stuff
> > (read/write/open/etc). Perhaps the latter should be used for reading
> > data from stdin instead anyway, though...?
>
> hmm
> the standard open(2)/read(2) are used, not fopen/fread
> so setvbuf() has no sense?

It definitely has an effect here, and actually I doubt that there are 
different buffers when using the FILE functions or the other ones taking fd's.

Bye
Alex



More information about the MPlayer-dev-eng mailing list