CS360 Final Exam: December 12, 2000. Question 1

Suppose we execute the following from the shell:
UNIX> sort < f1 | head -5 | cat -n

For each question below, you are to answer what happens to the given process in terms of how it exits. You are to answer from the choices below.

a. read() returns 0, and it exits instantly.
b. read() returns 0, it does some processing, writes output and exits normally.
c. It exits because it receives SIGPIPE.
d. It exits because it receives SIGSEGV.
e. It exits normally, even though read() has not returned zero.
f. It exits before making the execvp() call.
g. It exits because the execvp() call fails.
h. None of the above.

For parts i-iii, suppose f1 is a three line file.

For parts iv-vi, suppose f1 is a 100,000 line file.

For parts vii-ix, suppose f1 does not exist.

For parts x-xii, suppose the program cat does not exist, and f1 is a one line file.