Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <20031001181139.17004.qmail@web40008.mail.yahoo.com> Date: Wed, 1 Oct 2003 11:11:39 -0700 (PDT) From: Jan Jaeger Subject: Re: setvbuf / [ANNOUNCEMENT] Updated: cygwin-1.5.5-1 To: cygwin AT cygwin DOT com In-Reply-To: <20031001175824.GA9448@redhat.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1480356479-1065031899=:16603" Note-from-DJ: This may be spam --0-1480356479-1065031899=:16603 Content-Type: text/plain; charset=us-ascii Content-Id: Content-Disposition: inline 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, jj --- Christopher Faylor wrote: > On Wed, Oct 01, 2003 at 10:49:08AM -0700, Jan Jaeger > wrote: > >I have downloaded the latest (I think?) version of > cygwin, but my > >problem still persists. uname -a reports: > CYGWIN_NT-5.1 jj > >1.5.5(0.94/3/2) 2003-09-20 16:31 i686 unknown > unknown Cygwin. The 0.94 > >does not look quite right to me is this correct? > If so, which ftp site > >would contain a 1.xx? > > setup.exe downloads the latest version of > everything. This is confirmed > by the 1.5.5 in your version above. Since I > announced this new version > 10+ days ago, it is a safe bet that all of the > mirror sites listed by > setup.exe have cygwin 1.5.5. > > The test case that you previously provided works as > expected. If you > are having other problems, you'll need to clarify > them with a new test > case. > -- > Please use the resources at cygwin.com rather than > sending personal email. > Special for spam email harvesters: send email to > aaaspam AT sourceware DOT org > and be permanently blocked from mailing lists at sources.redhat.com __________________________________ Do you Yahoo!? The New Yahoo! Shopping - with improved product search http://shopping.yahoo.com --0-1480356479-1065031899=:16603 Content-Type: text/plain; name="setvbug.c" Content-Description: setvbug.c Content-Disposition: inline; filename="setvbug.c" #include #include #include #include static pthread_attr_t logger_attr; static pthread_cond_t logger_cond; static pthread_mutex_t logger_lock; static pthread_t logger_tid; static int pipefd[2]; void *logger_thread(void *arg) { int n; char buffer[80]; setvbuf(stdout, NULL, _IOLBF, 0); // *** THIS DOES NOT WORK PROPERLY *** pthread_mutex_lock(&logger_lock); pthread_cond_signal(&logger_cond); pthread_mutex_unlock(&logger_lock); while(1) { n = read(pipefd[0], buffer, sizeof(buffer)); buffer[n] = '\0'; fprintf(stderr,buffer); } } main() { pipe(pipefd); dup2(pipefd[1],STDOUT_FILENO); pthread_attr_init(&logger_attr); pthread_attr_setstacksize(&logger_attr,1048576); pthread_attr_setdetachstate(&logger_attr,PTHREAD_CREATE_DETACHED); pthread_cond_init (&logger_cond,NULL); pthread_mutex_init (&logger_lock,NULL); pthread_create (&logger_tid, &logger_attr, logger_thread, NULL); pthread_mutex_lock(&logger_lock); pthread_cond_wait(&logger_cond,&logger_lock); pthread_mutex_unlock(&logger_lock); //setvbuf(stdout, NULL, _IOLBF, 0); printf("test1\n"); fflush(stdout); printf("test2\n"); sleep(5); printf("test3\n"); fflush(stdout); sleep(5); pthread_kill(logger_tid,SIGKILL); fprintf(stderr,"done\n"); } --0-1480356479-1065031899=:16603 Content-Type: text/plain; charset=us-ascii -- 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/ --0-1480356479-1065031899=:16603--