Mail Archives: cygwin/2004/11/11/12:16:42
On Thu, Nov 11, 2004 at 05:02:40PM -0000, Dave Korn wrote:
>2) if I make any mistakes or offer bad advice someone will pull me on it
>fairly sharpish,
>
> I don't think you have any right to expect that. IIRC, there are _zero_
>guarantees provided by the C language standard and the C stdio library
>specification about the order in which stdio buffers will be flushed. It's
>entirely at the whim of the runtime library, and as you can see, when a program
>reaches the termination routines under cygwin, it chooses to flush the stderr
>buffer before the stdout buffer.
stderr is not normally buffered. stdout is normally unbuffered or line
buffered if is attached to a "tty". So, stderr should have been flushed
before hitting exit. So should stdout in the normal case.
On Cygwin, I get stdout first, stderr second with and without setting
CYGWIN=tty. If I pipe or redirect the output somewhere then I
get the opposite order, which is what I would expect.
Which, means, of course, that my cable box analogy still holds.
cgf
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -