Subject: Re: [PATCH] Don't fflush(stdout) when it's not helpful

From: Theodore Tso <[email-masked]>
Date: Sat, 30 Jun 2007 10:27:41 -0400

On Fri, Jun 29, 2007 at 09:24:41PM -0700, Linus Torvalds wrote:
> So you basically cannot get "perfect" with stdio. It's impossible. But the 
> above re-ordering will at least get you _closer_, and *most* of the time 
> you'll get exactly the error you'd expect.

Well, we *can* get perfect with stdio, but I can pretty much guarantee
no one will like it.  We could wrap printf, fprintf, purchar, et. al,
and check each of them for an error return.  The spec doesn't
currently specify that errno is supposed to be set, but a defect[1]
was filed last year saying that fprintf et.al, are indeed supposed to
set errno and not throw it away.

It would be a real pain in the *ss, though....

							- Ted

[1] http://www.opengroup.org/austin/mailarchives/ag-review/msg02161.html