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 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 18:10
Acompressor receives the shaft work to decrease the pressure of the fluid. a)- true b)- false
Answers: 3
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
question
Engineering, 04.07.2019 18:10
Thermal stresses are developed in a metal when its a) initial temperature is changed b) final temperature is changed c) density is changed d) thermal deformation is prevented e) expansion is prevented f) contraction is prevented
Answers: 2
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
Chemistry, 29.09.2019 01:10
question
Medicine, 29.09.2019 01:10
question
Mathematics, 29.09.2019 01:10
question
Mathematics, 29.09.2019 01:10
question
Mathematics, 29.09.2019 01:10
question
Mathematics, 29.09.2019 01:10
Questions on the website: 13722360