This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/682] stdout and file descriptor mismatch after a freopen()
- From: "michael dot kerrisk at gmx dot net" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 16 Jun 2005 15:50:18 -0000
- Subject: [Bug libc/682] stdout and file descriptor mismatch after a freopen()
- References: <20050119161710.682.vincent+libc@vinc17.org>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From michael dot kerrisk at gmx dot net 2005-06-16 15:50 -------
(In reply to comment #4)
> However the current behavior violates the ISO C standard (or the system
> documentation is incorrect).
Which part of the standard do you believe this violates?
SUSv3 permits the Linux behaviour, as far as I can see.
And I believe it is common on other implementations also.
> But the solution to reserve the fd 0, 1 and 2 for stdin, stdout and stderr in
> ISO C programs (as long as a race condition doesn't occur) would be OK. Note
> that a C implementation isn't required to have fully reentrant standard
> functions, so that if the programmer wants stdin, stdout and stderr to really
> correspond to the standard streams, then he should also make sure that no race
> condition occurs.
I do not believe any change should be made. See
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=295859
for further information.
Cheers,
Michael
--
http://sources.redhat.com/bugzilla/show_bug.cgi?id=682
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.