This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: stderr vs. STDERR_FILENO
Andreas Schwab wrote:
Mark Mitchell <mark@codesourcery.com> writes:
(2) stderr freopen'd (and not attached to fd 2)
stderr freopen'd means it is still attached to fd 2.
Maybe on some implementations, but that's not required.
Typical implementations do a close, followed by an open.
In threaded code, some other thread might grab the fd between the close
and the open.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com