Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - spawn error: Page 1 of 10 (10 Items)
   
spawn error  
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