8-3

.pdf

School

University of Massachusetts, Amherst *

*We aren’t endorsed by this school

Course

230

Subject

Computer Science

Date

Jul 1, 2024

Type

pdf

Pages

2

Uploaded by MajorTank837

4/29/24, 3 : 04 AM Lesson 3, Process Details (LESSON QUIZ): Attempt review Page 1 of 2 https://umass.moonami.com/mod/quiz/review.php ? attempt=2917547&cmid=2293123 Question 1 Correct 3.00 points out of 3.00 Question 2 Correct 2.00 points out of 2.00 Question 3 Correct 2.00 points out of 2.00 Started on Sunday, April 7, 2024, 11 : 22 PM State Finished Completed on Sunday, April 7, 2024, 11 : 22 PM Time taken 44 secs Grade 10.00 out of 10.00 ( 100 %) The waitpid() and fork() system calls are the most important system calls required to write a shell such as bash. Select one: True False The fork() and execve() system calls are required to write a shell such as bash. Imagine a parent process that opens the same file F twice for writing returning the file descriptors fd1 and fd2. The parent process then forks a new child process. If the parent writes the letter "A" to fd1 and the child writes "B" to fd2 then the underlying file F will have the contents "AB". Select one: True False The file F will definitely not contain "AB". In fact, it will not even contain "BA". It will either contain "A" or "B" depending on whether the child writes to F first or the parent writes to F first. The reason for this is because opening a file twice creates two separate entries in the open file table each having a different file position. Initially, both start at position 0. A write to one file descriptor will only update the open file table entry for the associated file descriptor, not both. Imagine a parent process that opens the same file F twice for writing returning the file descriptors fd1 and fd2. The parent process then forks a new child process. If the parent writes the letter "A" to fd1 and the child writes "B" to fd1 then the underlying file F will have the contents "AB". Select one: True False
4/29/24, 3 : 04 AM Lesson 3, Process Details (LESSON QUIZ): Attempt review Page 2 of 2 https://umass.moonami.com/mod/quiz/review.php ? attempt=2917547&cmid=2293123 Question 4 Correct 3.00 points out of 3.00 Which of the following best describes a successful "execve" system call ? Select one: a. called once returns twice b. called once returns once c. called twice returns once d. called twice and never returns e. called once and never returns Your answer is correct. Lesson 3, Process Details (SLIDES) Jump to... Processes (CODE)
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help