Subject: fork - Is there a problem:
From: [email-masked] (Soumen Biswas)

30 Aug 1997 12:42:13 -0700
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain
X-Mailer: Novell GroupWise 4.1
Original-To: [email-masked]
Content-Disposition: inline
Original-Sender: [email-masked]

Hi ,
I am new to gnu-win32 .  I have the following prob:  
while forking ( ver - b18  .)

/* Example Code*/
int main()
{
int x;
if(  !fork() ) 
  printf("Child\n" );
else
  printf("Parent\n");

/* If wait is commented out  the program shows errors*/
wait( &x ) ;
return x ;
}

The the above code works fine BUT IF wait() is commented out  the program
becomes unpredictable ( sometimes it works ...  sometimes
shows  EXCEPTION TRAPPED ... I think it depends on which process finishes
first - chid || parent  .
 
Is the above behaviour a  bug  or is 
this the way fork() is supposed to work in cygwin

Is there a workaround ?????
thanx 

Soumen 
[email-masked]

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".