delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/10/02/00:46:39

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Date: Thu, 2 Oct 2003 00:45:47 -0400
From: Christopher Faylor <cgf-rcm AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: setvbuf / [ANNOUNCEMENT] Updated: cygwin-1.5.5-1
Message-ID: <20031002044546.GA13713@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20031001175824 DOT GA9448 AT redhat DOT com> <20031001181139 DOT 17004 DOT qmail AT web40008 DOT mail DOT yahoo DOT com>
Mime-Version: 1.0
In-Reply-To: <20031001181139.17004.qmail@web40008.mail.yahoo.com>
User-Agent: Mutt/1.4.1i

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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019