Subject: Re: newbie
From: [email-masked] (Kin-man Chung)

22 Jan 1997 17:07:48 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Mailer: Mozilla 3.0 (Win95; I)
Original-To: [email-masked]
Original-Cc: [email-masked]
Original-Sender: [email-masked]

I think there is some problems with cygwin32.dll when returning from
child process that is not wait'ed.  To get around this problem, try the
following change to your program (I don't have access to gnu-win32 from
where I send my mail, so I cannot try this out myself.)

	if (pid > 0) {
		int status;
		wait(&status);
		printf("Father\n");
	}

Jorge Fernandez Suarez wrote:
> 
> Hello, I'm newbie with this compiler, always work with djgpp for DOS,
> but
> after take a look to the gnu-win32 compiler, I have decided to start
> with
> it, I've install it and try this little program:
> 
> # include <stdio.h>
> # include <conio.h>
> # include <unistd.h>
> 
> void main() {
>   int pid;
>   printf("Hello gnu-win32\n");
> 
>   pid= fork();
> 
>   if( pid>0 )     printf("Father\n");
>   else if( !pid ) printf("Son\n");
>   else            printf("Error\n");
> 
>   getch();
> }
> 
> ... and It fails at the fork sentence...
> I think that maybe I've not do a good installation on my computer (I'm
> newbie to the unix too)
> 
> well... I tell you how i do it to compile the program... i think it's
> strange...
> 
>         I load the 'bash.exe' file
>         I write "gcc a.cc"
>         I exit from 'bash'
>         I run 'a.exe'
> 
> ¿Any ideas?   ... the faq I got don't explain the use of the compiler...
> r:-?
> 
> thanx
>         Jorge
> -
> For help on using this list, send a message to
> "[email-masked]" with one line of text: "help".
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".