Write a C program which fork the process and have the child execute a process.You have...

70.2K

Verified Solution

Question

Programming

Write a C program which fork the process and have the childexecute a process.You have to implement void forkexec(char**argv).This takes in an array of strings representing arguments.Thefirst argument is the filename of an executable (which will begiven as a \"./a\").The remaining terms would be arguments for saidexecutable.The array is null terminated and you need to fork yourprocess.The child needs to call exec/execvp to execute thespecified file with the specified arguments. Also have the parentwait on the child. Assume that the first argument of argv is thefile name of the executable and argv is null terminated.

Answer & Explanation Solved by verified expert
4.4 Ratings (876 Votes)
The program demostrates the use of fork to create achild tread and inside the child thread we will execute a programThe parent process will wait until the child executes using    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students