Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: 2 Oct 2001 01:26:41 -0000 Message-Id: Mime-Version: 1.0 Content-Type: text/plain Content-Disposition: inline From: danny AT ishiboo DOT com (Danny Dulai) To: cygwin AT cygwin DOT com Subject: Re: frok() X-Mailer: Liam [version 0.7] In-Reply-To: <15288.44810.424000.170375@gargle.gargle.HOWL> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id f91ISxQ09886 you need to read the fork() manpage, your code below exits before it ever gets to the while(). i don't think you understand the return vals of fork(). -- _________________ danny AT ishiboo DOT com Scr34m writes: > Hi all, > > Here is these simple program how can i make programs to stay in > background and run. Every 1 second do everything ?? > > Fork works in cygWin? > > I installed it as DOS and as Unix but doesn't work :( > > int main (void) { > if(fork()) > exit(0); > else { > perror("cannot fork"), exit(1); > } > while(1) { > printf("jkk"); > sleep(60); > } > } > > --- > Bye Scr34m > > | www.inertia.hu | www.frontember.hu | eurohack.at.hu | -- 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/