This is the mail archive of the
mailing list for the libstdc++ project.
Re: Information on a commit related to libstdc++/9533
Nathan Myers wrote:
I agree that this is a very serious problem. Setting non-blocking
mode is a radical change to expected semantics, so that if that mode
is not available, it cannot be right just to leave it off.
I think the real error is in setting non-blocking mode: that cannot be
the right solution to whatever problem it meant to solve. I don't know
what problem it was meant to solve. I do know that we have had iostream
implementations for more than a decade that perform well on both files
and ttys and do not depend on setting a non-blocking mode.
Thanks Nathan for your feedback: in fact, just reverting the hunk of 6746
which sets the non-blocking mode (see 9533 audit trail) appears to fix
the problem without regressing on 6746.
But... regtesting we got the failure of this test ("fail bit was not set!"):
// libstdc++/2913, libstdc++/4879
// John Fardo <jfardo at laurelnetworks dot com>, Brad Garcia <garsh at attbi dot com>
if (0 != mkfifo("xxx", S_IRWXU))
std::cerr << "failed to creat fifo" << std::endl;
int fval = fork();
if (fval == -1)
std::cerr << "failed to fork" << std::endl;
else if (fval == 0)
* ISO/IED 14882:1998(E) 220.127.116.11.4
* void close();
* Effects: Calls rdbuf()->close() and, if that function fails
* (returns a null pointer), calls setstate(failbit)...
if (!(ofs.rdstate() & std::ios::failbit))
std::cerr << "fail bit was not set!" << std::endl;