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

Re: Bug#121642: libstdc++3: Unable to do buffered cout (?)



> I tried to investigate and found nothing. I was thinking maybe
> there is a switch for it or something, but found none. Anyway, by
> default, the output should be buffered, AFAIK ... and unless I am
> missing anything.
> 
> Any clues?

That appears to be the implementation of the requirement that
std::cout and std::stdout are always synchronized (i.e. tied).
This is done in ios.cc

  void
  ios_base::Init::_S_ios_create(bool __sync)
  {
    int __out_bufsize = __sync ? 0 : static_cast<int>(BUFSIZ);
    int __in_bufsize = __sync ? 1 : static_cast<int>(BUFSIZ);

In gcc 2.95, tieing stdout and cout was achieved by having the same
buffer objects. Since the ABI changed, and since the buffer is in
glibc, this isn't possilbe anymore.

Regards,
Martin



Reply to: