This is the mail archive of the glibc-bugs@sources.redhat.com mailing list for the glibc 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]

[Bug libc/682] stdout and file descriptor mismatch after a freopen()


------- 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.


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