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

D Richard Felker III dalias at aerifal.cx
Mon Apr 29 19:01:12 CEST 2002


On Mon, Apr 29, 2002 at 06:39:20PM +0200, Alexander Neundorf wrote:
> 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.

Yes there are. In fact, there are NO buffers on the operations taking
fd's, aside from on the kernel's side, e.g. in the pipe. No idea why
it makes a difference; it shouldn't.

Rich




More information about the MPlayer-dev-eng mailing list