subject
Engineering, 22.02.2020 01:43 prettyswagg63oz3tyz

Creating a Child Process
The first task is to modify the main() function in the code shown above so that a child process is forked and executes the command specified by the user. This will require parsing what the user has entered into separate tokens and storing the tokens in an array of character strings (args in above code). For example, if the user enters the command ps -ael at the CS30> prompt, the values stored in the args array are:
args[0] = "ps"
args[1] = "-ael"
args[2] = NULL
This args array will be passed to the execvp() function, which has the following prototype:
execvp(char *command, char *params[]);
Here, command represents the command to be performed and params stores the parameters to this command. For this project, the execvp() function should be invoked as
execvp(args[0], args)
Be sure to check whether the user included an & to determine whether or not the parent process is to wait for the child to exit.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 03.07.2019 19:30
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
question
Engineering, 04.07.2019 12:10
On a average work day more than work place firs are reorted
Answers: 1
question
Engineering, 04.07.2019 18:10
Afluid flows with a velocity field given by v=(x/t)i.. determine the local and convective accelerations when x=3 and t=1.
Answers: 2
question
Engineering, 04.07.2019 18:10
Aplate clutch has a single pair of mating friction surfaces 250-mm od by 175-mm id. the mean value of the coefficient of friction is 0.30, and the actuating force is 4 kn. a) find the maximum pressure and the torque capacity using the uniform-wear model. b) find the maximum pressure and the torque capacity using the uniform-pressure model.
Answers: 3
You know the right answer?
Creating a Child Process
The first task is to modify the main() function in the code shown abo...
Questions
question
Mathematics, 29.06.2019 18:00
question
Mathematics, 29.06.2019 18:00
Questions on the website: 13722361