This is the mail archive of the cygwin@sourceware.cygnus.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]

fork()



I have a problem with threading. I use fork() so my app listens for
connections from a remote host, accept() it, forks, the parent loops and
closes the sockfd from the child and listens again:

  for(;;)
  {
   if(sockfd!=(int)NULL) close(sockfd);
   sockfd = accept(sockfd2, (struct sockaddr *)&address, &len);
   if(pid=fork()) break;
  }

Now it's telling me this error: child died before initialization..
Am I doing something wrong here ?


 




Drow@DarkElf.net
----------------------------------------------------------------------
DarkElf Network SysAdmin                        http://www.darkelf.net
OKC.OK.US.UnderNet.Org Operator                http://www.undernet.org
    Check the main resource for developers at www.fastethernet.net
----------------------------------------------------------------------

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


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