Date: Wed, 3 Jan 2001 11:16:42 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: Martin Str|mberg cc: DJGPP-WORKERS Subject: Re: Bug 000323 (LONG) In-Reply-To: <200101030654.HAA01457@father.ludd.luth.se> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp-workers AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk 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.