Re: CVS update [cvs1-11-x-branch]: /ccvs/src/
Paul Eggert <[email protected]> Thu, 02 Sep 2004 12:46:28 -0700
| Newsgroups | gmane.comp.lib.gnulib.bugs,gmane.comp.version-control.cvs.bugs |
|---|---|
| Message-ID | <[email protected]> |
Derek Robert Price <[email protected]> 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'.