libstdc++/5457: Writing to buffer stream writes each byte using a system write() call.
emaros@ligo.caltech.edu
emaros@ligo.caltech.edu
Tue Jan 22 13:46:00 GMT 2002
>Number: 5457
>Category: libstdc++
>Synopsis: Writing to buffer stream writes each byte using a system write() call.
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Tue Jan 22 13:46:05 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: emaros@ligo.caltech.edu
>Release: gcc-3.0.3
>Organization:
>Environment:
RedHat 7.2 Linux/Intel
Reading specs from /ldcg/lib/gcc-lib/i686-pc-linux-gnu/3.0.3/specs
Configured with: ../configure --prefix=/ldcg --with-prefix=/ldcg --enable-long-long
Thread model: single
gcc version 3.0.3
>Description:
When writing to cout, each character is being written via
the system write() call.Ouput of strace:
...
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40206000
ioctl(1, TCGETS, {B38400 opost isig icanon echo ...}) = 0
write(1, "H", 1H) = 1
write(1, "e", 1e) = 1
write(1, "l", 1l) = 1
write(1, "l", 1l) = 1
write(1, "o", 1o) = 1
write(1, " ", 1 ) = 1
write(1, "W", 1W) = 1
write(1, "o", 1o) = 1
write(1, "r", 1r) = 1
write(1, "l", 1l) = 1
write(1, "d", 1d) = 1
write(1, "!", 1!) = 1
write(1, "\n", 1
) = 1
munmap(0x40206000, 4096) = 0
_exit(0) = ?
>How-To-Repeat:
g++ t.cc
strace ./a.out
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="t.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="t.cc"
I2luY2x1ZGUgPGlvc3RyZWFtPgoKaW50Cm1haW4oKQp7CglzdGQ6OmNvdXQgPDwgIkhlbGxvIFdv
cmxkISIgPDwgc3RkOjplbmRsOwp9Cg==
More information about the Gcc-bugs
mailing list