| www.delorie.com/archives/browse.cgi | search |
| Mailing-List: | contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm |
| List-Subscribe: | <mailto:cygwin-subscribe AT sources DOT redhat DOT com> |
| List-Archive: | <http://sources.redhat.com/ml/cygwin/> |
| List-Post: | <mailto:cygwin AT sources DOT redhat DOT com> |
| List-Help: | <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs> |
| Sender: | cygwin-owner AT sources DOT redhat DOT com |
| Delivered-To: | mailing list cygwin AT sources DOT redhat DOT com |
| Message-ID: | <3B4C1BF7.1807A0C7@aspen.mine.nu> |
| Date: | Wed, 11 Jul 2001 03:27:19 -0600 |
| From: | Adam Stallard <adam AT aspen DOT mine DOT nu> |
| X-Mailer: | Mozilla 4.76 [en] (Windows NT 5.0; U) |
| X-Accept-Language: | en |
| MIME-Version: | 1.0 |
| To: | cygwin AT cygwin DOT com |
| Subject: | 1.3.2 : Fork + Sleep = problem |
Here's a short c program that works as expected compiled under some
other unix platforms, but not under my cygwin (1.3.2 , Win 2000)
platform.
If a call to wait() is added to the code before the sleep command, it
behaves as expected; but I shouldn't have to do that.
#include <stdio.h>
#include <unistd.h>
void main(){
for(int a=0;a<256;a++){
pid_t poo=fork();
if(!poo)
exit(0);
sleep(1);
printf("%d\n",a);
}
}
This should count up to 255, pausing 1 second between each count; on my
cygwin platform it counts up to 63 with pauses, and then rushes through
the rest of the count. Select, poll, and usleep also fail in this
situation.
--Adam Stallard
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |