Reputation: 649
So I am executing a file with execv() inside a child process with its file descriptors possibly being modified based on the input.
However, I am trying to execute one process after the next from the child, but because execv() takes over the child process, calling execv() after the previous call doesnt work.
How would I go about executing multiple processes from a single child?
Upvotes: 0
Views: 224
Reputation: 6258
When you call execv
in a process, then the original process image is overwritten with the a new one from the program you are executing. That means that you can not run multiple execv
's in the same process, as only the first one will ever get executed.
To get around this, you have to spawn a new process for each execv
you plan to run.
Upvotes: 0