This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

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


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