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]

Re: frok()


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@ishiboo.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/


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