Mail Archives: djgpp-workers/2001/01/03/04:18:23
On Wed, 3 Jan 2001, Martin Str|mberg wrote:
> > - Instead of adding an fseek to each buffered stdio function (such
> > as putc, fwrite, etc.), isn't it better to do that inside _flsbuf,
> > which is the only function used by buffered functions to actually
> > write to the file?
>
> Ok. I'm not an expert. There isn't anything that doesn't go through
> _flsbuf() that we must watch out for? (Like unbuffered output?)
_All_ output from buffered stdio functions goes through _flsbuf. In the
unbuffered case, _flsbuf is called for each character.
The data gets into _flsbuf either directly, from functions like fwrite,
or via putc (either directly or from _doprnt).
If _flsbuf is not called in some case, that is a grave bug, because
_flsbuf provides several important features, such as the termios hooks,
that would be badly broken if _flsbuf is bypassed.
- Raw text -