This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: iostream buffer flushing and unitbuf


Thanks Jonathon. That's making more sense now.

i

------ Original Message ------
Received: 07:31 PM COT, 01/31/2011
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: "Ian S. Worthington" <ianworthington@usa.net>Cc: libstdc++@gcc.gnu.org
Subject: Re: iostream buffer flushing and unitbuf

> On 31 January 2011 23:46, Ian S. Worthington wrote:
> > Hi --
> >
> > We're using the gnu iostream library under z/tpf.
> >
> > Multiline output messages to cout are being prefixed with a z/tpf header
in
> > such a way as to make us suspect that each \n is generating a flush.
> >
> > I have tried setting nounitbuf without effect.
> >
> > When I look through the iostream code I find a number of places which set
the
> > unitbuf flag but very few places which actually interrogate it.
> >
> > Could someone point me to where this flag is being used to control buffer
> > flushing?
> 
> It's done by the sentry::~sentry destructor, defined in <ostream>
> 
> But that should operate on units of "an output operation" which are
> not related to occurrences of \n
> 
> e.g. this is a single output operation:
> std::cout << "foo\nbar\n";
> 
> It sounds more like something affected by the fact the stdout stream
> is line-buffered when attached to a terminal, which would be
> controlled by something below the level of C++ iostreams.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]