Computer Science 322 Quiz 4 - Name ____________________ 1. The input parameter(s) passed INTO the pipe() system call is/are: a. A integer value representing b. A pointer to an array of the pipe handle and another two integers integer value representing the capacity of the pipe. c. The PID of the process to which to connect the pipe. 2. For a process to receive an End-of-file indication on reading a pipe, it is necessary that: a. at least one process b. all processes that that has an open write handle have the pipe open for reading close the write handle. close the read handle c. all process that have an open write handle close the write handle. Consider the following code segment: 1 pipe(pd); ----------> 8 close(pd[1]); 2 rc = fork(); | 9 rc = fork(); 3 if (rc == 0) | 10 if (rc == 0) 4 { | 11 { 5 c1(pd[1]); | 12 c2(pd[0]); 6 exit(1); | 13 exit(1); 7 } ---------- 14 } 15 wait(&status); 16 wait(&status); 3. The way the program is presently written, after the c1 function closes pd[1], a. the c2 function will get b. the c2 function will not eof if it tries to read get eof if it tries to read the pipe. the pipe. 4. Now, suppose the close(pd[1]) is moved from its location at line 8 and inserted between lines 9 and 10. In this case, after the c1 function closes pd[1], a. the c2 function will get b. the c2 function will not eof if it tries to read get eof if it tries to read the pipe. the pipe. 5. Now, suppose the close(pd[1]) is moved from its location at line 8 and inserted between lines 2 and 3. Which best describes the situation now.. a. the c1 function will not b. the c1 function will be able be able to write into the to write and the c2 function will the pipe. get eof when c1 closes pd[1]. c. the c1 function will be able to write but the c2 function will not get eof when c1 closes pd[1].