|
07/09/2010 8:50 AM
post59058
|
int main()
{
char *args[] = {"child", NULL };
pid_t pid;
struct inheritance inherit;
pid = spawn("child",0,NULL,&inherit,args, environ);
if (pid == -1)
perror("spawn() failed");
else
printf("spawned child, pid = %d\n", pid);
return (0);
}
When i run the above code I get the error -> spawn() failed: No such file or directory
I also tried with /proc/boot and /bin path to the child. But still getting error.
Cannot figure out where the error lies.
Thanks a lot for the help
Abhi
|
|
|
|
|