[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: texinfo-5.9.90 pretest available

From: Eli Zaretskii
Subject: Re: texinfo-5.9.90 pretest available
Date: Fri, 27 Feb 2015 16:39:35 +0200

> Date: Fri, 27 Feb 2015 13:43:48 +0000
> From: Gavin Smith <address@hidden>
> Cc: Eli Zaretskii <address@hidden>, Karl Berry <address@hidden>, Texinfo 
> <address@hidden>
> On 27 February 2015 at 13:13, Ken Brown <address@hidden> wrote:
> > No, it turns out that it has to do with buffered I/O.  See the thread
> > starting here:
> >
> >   https://cygwin.com/ml/cygwin/2015-02/msg00887.html
> >
> > Replacing the fseek in line 841 by another call to freopen fixes the
> > problem.  I don't know if that's the best solution.
> >
> The setvbuf solution might work - I'm not sure if the buffering
> property of the FILE stream will be inherited by the subprocess, or
> just the file descriptor (i.e. what "open" would return instead of
> what "fopen" would return).

Isn't FILE buffering implemented in libc, i.e. in user-space private
to the application?  If it is, then the buffer is not inherited.

The buffering that the Cygwin maintainer alluded to is the one below
stdio, in 'read' and its ilk.  That one emulates the OS buffering, and
is indeed inherited together with the file descriptor.

> The main thing would be if we are reading from an uncompressed file
> in install-info (the parent process) - buffering should be turned
> back on in that case. Another solution would be to read the first
> few bytes of the file using "open", "read" and "lseek", and make a
> FILE stream afterwards from the file descriptor; this would avoid
> any buffering done by the high-level FILE streams.

I'm actually asking myself why do we redirect stdin to the file before
reading it, instead of using 'fopen' to read the few first bytes, and
then, only if it is compressed, redirect stdin to it and call 'popen'.
Wouldn't that work around the problem?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]