Sale!

Exercise 4 已開始

Original price was: $40.00.Current price is: $30.00.

Category:

Description

Rate this product

Exercise 4
已開始: 9⽉11⽇ 16:32
測驗說明
問題 1 1 分數
上傳
Log in to CLEAR.
Write a C program that uses fork() to have a child process wait on character input
and has a parent process wait for the child process to finish. The program should
print the PID of the child process so that we can see it later. Check out the code in
this YouTube video for reference: Dhananjai Rao, “Fork and Exec in Linux”.

(https://www.youtube.com/watch?v=nwm7rJG90i8)
(https://www.youtube.com/watch?v=nwm7rJG90i8)
Compile and run your program – it will print the child process PID and a 0, then
expect you to enter text. Don’t enter text. Instead, use ctl+z (control and z keys at
the same time) to “background” this process, then use the below command
(replacing netID with your netID) to show the two instances of your program.
ps -u netID
Now use the command fg to bring the program back to the foreground, type some
text and hit enter. It should end your program.
Submit one screenshot of your terminal window that shows you running the
program, backgrounding it, displaying the PIDs of the now two instances of your
program, foregrounding the program, and entering text (which ends the program).
選擇檔案
測驗保存於 16:52 提交測驗

Reviews

There are no reviews yet.

Be the first to review “Exercise 4 已開始”

Your email address will not be published. Required fields are marked *