NEW TEST checks whether sync_with_stdio(true) (i.e. default case) works

Loren James Rittle rittle@latour.rsch.comm.mot.com
Sun Apr 1 00:00:00 GMT 2001


In article < 200101171042.f0HAgti93168@latour.rsch.comm.mot.com >, I wrote:

> As written, this test only checks the mixing of output on cout and
> stdout but could be extended to check mixing of input on cin and
> stdin.

Aside, it would be nice if the sequence in the test translated, at the
OS-level, to exactly two write() and zero seek() calls when stdout is
an interactive stream and only one write() call when stdout is a
non-interactive stream.  Currently, with a particular patch set I have
to allow this test to pass, it is nine write() and three seek() calls.
The seek() calls all disappear if the explicit use of std::endl is
replaced with "\n".  If the explicit sync() call in
fstream.tcc:_M_really_overflow() is circumvented whenever working with
an ostream related to stdout or stderr, then I can reach the ideal
number of write() calls.

I can only submit parts of the patch set at this time since some parts
are still too kludgey to release.  I will be doing that pronto.

Regards,
Loren


More information about the Libstdc++ mailing list