This is the mail archive of the
mailing list for the Cygwin project.
Re: setvbuf / [ANNOUNCEMENT] Updated: cygwin-1.5.5-1
On Wed, Oct 01, 2003 at 11:11:39AM -0700, Jan Jaeger wrote:
>The attached test case does should display test2 wait five seconds and
>then display test3, instead on my system it issues test2 and test3
Thanks for the test case. I've checked in an ugly hack to work around
the problem but as a workaround that you can use which avoids having
to upgrade cygwin, adding something like:
at the beginning of your program should cause things to work better.
The basic problem was that newlib thought that stdout had to be
initialized since it didn't recognize the fact that the buffer had
been set in another thread. So, it ended up reinitializing the
buffering on stdout. Calling printf with an empty string will
cause stdout to be initialized and so subsequent calls to setvbuf
will stick. This is essentially what I've done in the cygwin dll.
I'm building a snapshot now. Cygwin is in a somewhat interesting
state right now, so the snapshots may be a little more unstable than
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html