This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin 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: 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
>simultanuously.

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:

printf("");

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

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/


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