Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A. It will take the command as input and will execute that in a new process. When your program gets the program name, it will

A. It will take the command as input and will execute that in a new process. When your program gets the program name, it will create a new process using fork() system call, and the new process (child) will execute the program. The child will use the execv() function in the below to execute a new program. Use execv() instead of execvp(), which means that you will have to read the PATH environment variable, then search each directory in the PATH for the command file name that appears on the command line. Important Notes: 1. Using the system() function is not allowed for part A! 2. In the project, you need to handle foreground and background processes. When a process run in foreground, your shell should wait for the task to complete, then immediately prompt the user for another command. myshell: gedit A background process is indicated by placing an ampersand (&) character at the end of an input line. When a process run in background, your shell should not wait for the task to complete, but immediately prompt the user for another command. myshell: gedit & With background processes, you will need to modify your use of the wait() system call so that you check the process id that it returns.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Experts Guide To Database 2

Authors: Bruce L. Larson

1st Edition

0070232679, 978-0070232679

More Books

Students also viewed these Databases questions

Question

Calculate NPV.

Answered: 1 week ago

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago