Tuesday, 15 May 2012

c - Running a separate process within a parent process -


I am creating a basic process that creates a child using Kanka (), and then a shared memory block That can be accessed by both parent and child I have created child processes using the WIN32 api (by creating many .exe files and running them all and then calling them using the createProcess () function Do), but a little bit of steps for Linux The Chitta.

I have created a separate file in which the child has the code. I think I will make the hair process using the fork, then to call the other C file (pid == 0) in the hair process Use command (exec)? Do I Need to Run Another File Before? Or can it just be sitting in one directory?

Any help is appreciated

thanks

< P> After the fork (), there are two processes, parents and children, in the parent process, the fork system calls the child's process id. In the hair process, the fork returns (0). So, if the return value of fork () is zero, then you can call a exec system call with the executable file name for the child process.


No comments:

Post a Comment