This is the mail archive of the
cygwin
mailing list for the Cygwin project.
vfork always fail problem
- From: Huang Bambo <bambo dot huang at gmail dot com>
- To: The Cygwin Mailing List <cygwin at cygwin dot com>
- Date: Fri, 14 May 2010 12:29:48 +0800
- Subject: vfork always fail problem
[Bambo@bambo-notebook 4.4.4]$ cat tvfork.c
#include <sys/types.h>
#include <unistd.h>
#include <stdio.h>
int main(void)
{
pid_t pid = vfork();
if ( pid > 0 )
{
printf("I'm chield.\n");
_exit(0);
}
else if ( pid == 0 )
{
printf("I'm parent");
}
else
{
perror("vfork failed.");
}
}
[Bambo@bambo-notebook 4.4.4]$ make tvfork
cc tvfork.c -o tvfork
[Bambo@bambo-notebook 4.4.4]$ ./tvfork.exe
4 [main] tvfork 4136 fork: child -1 - CreateProcessW failed, errno 2
vfork failed.: No such file or directory
[Bambo@bambo-notebook 4.4.4]$ ./tvfork
3 [main] tvfork 2956 fork: child -1 - CreateProcessW failed, errno 2
vfork failed.: No such file or directory
I think maybe the wrong parameters were sent while calling CreateProcessW.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple