Question: Write a function in C called ForkExec() that combines the fork() and exec() system calls in linux . The function takes a NULL terminated array

Write a function in C called ForkExec() that combines the fork() and exec() system calls in linux. The function takes a NULL terminated array of strings, creates a process to run the new executable and returns after the child process terminates.

Test your code by the running the following main.c:

int ForkExec(char *temp[]) { .. }

void main(int argc, char *argv[]) {

ForkExec(argv);

return 1;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!