bug-cvs
[Top][All Lists]
Advanced

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

Re: CVS update [cvs1-11-x-branch]: /ccvs/src/


From: Paul Eggert
Subject: Re: CVS update [cvs1-11-x-branch]: /ccvs/src/
Date: Thu, 02 Sep 2004 12:46:28 -0700
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Derek Robert Price <derek@ximbiot.com> writes:

> I think we recently settled in this thread

Sorry, I didn't recall that.

> a wrapper around the fwrite() function would prove as effective and
> is almost certainly more efficient.

More efficient, yes.  But it's more effective only if you know that
only fwrite is used to deliver output (not fputc, fprintf, etc.), and
only if you know all the locations that invoke fwrite.  Furthermore,
surely you'll need to wrap fflush as well (you can't just call fclose
or rely on the default close), and it's not immediately clear to me
whether you can recover portably from an fflush EAGAIN failure.
Furthermore, I'm worried about bugs in fwrite implementations in the
presence of EAGAIN failures.

Also, I think your implementation will do the wrong thing if the
underlying fwrite writes out only part of a single object.

If output is unbuffered, and if you use only 'fwrite', then perhaps
it'd be simpler to use 'write' instead of 'fwrite'.  Or, if you're
using fwrite only to get buffering, perhaps it'd be simpler to buffer
things yourself and then use 'write'.




reply via email to

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