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]

[PATCH/RFC] Fix interactive half of libstdc++/6745


Hi everyone, hi Benjamin,

Jonathan Lennox fixed the non-interactive half of the
PR (and the related 8071, 8127) by adding code dealing
with in_avail == 0 like this:

...
else {
  _CharT __buf[256];
  streamsize __charsread = __sbin->sgetn(__buf,
sizeof(__buf));
  __xtrct = __sbout->sputn(__buf, __charsread);
  __ret += __xtrct;
  if (__xtrct != __charsread)
    break;
}
...

Due to the __sbin->sgetn call, which boils down to an
fstream call exactly as discussed for 8399 a few days
ago, we run into troubles with interactive tests (see
audit trail).

Therefore, I propose to fix the interactive half of
6745 exactly in the same way we fixed with Loren 8399,
that is making use of isatty. On systems supporting it
we get the best performance without sacrificing the
correctness of the interactive tests.

You will find attached a patch along these lines,
tested x86-linux, for performance too.

Opinions?

Of course this approach would be wrong if, more
basically, we believe that in_avail must never return
zero, thus invalidating in the first place Jonathan's
fix...

Ciao, Paolo.

///////////


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site
http://webhosting.yahoo.com

Attachment: patch_6745_int
Description: patch_6745_int


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