CS810D Advanced Programming in the UNIX Environment Fall 2008 Quiz 3 FULL NAME ______________________________________ USERNAME ______________________________________ 1) Your process receives the signal SIGSTOP. You can do the following: A. Catch it by providing a signal handler and perform some appropriate action. B. Cast it to SIGURG, so that a childs sigaction(2) can be invoked if necessary. C. Ignore the signal. D. All of the above. E. None of the above. Correct answer: E. (You can catch or ignore SIGTSTP, but not SIGSTOP.) 2) If process A calls fork, creating child process B, and process B then calls fork again, creating child process C, and process C calls exec to overlay itself with the new program image, in what order do the processes run after the first fork call? A. The order is A, B, C. B. The order is C, B, A. C. The order is B, A, C. D. There is no fixed order. E. All of the above. F. None of the above. Correct answer: C. 3) Process A forks, creating process B. Process A then exits, as does its parent. What will happen when Process B exits? A. Process B will become a zombie. B. Process A will become a zombie. C. Process B will be reaped by process 1, init. D. Process A will return from the zombie state. E. All of the above. F. None of the above. Correct answer: C. 4) How does a socketpair differ from a pipe? A. A socketpair is bidirectional; a pipe is unidirectional. B. A pipe is full-duplex, whereas a socketpair is half-duplex. C. A socketpair preserves record boundaries, whereas a pipe is a stream file. D. There is no difference between a pipe and a socketpair. Correct answer: A. 5) Name three possible ways of Interprocess Communication for two unrelated processes on a single host. Acceptable answers: - fifos - socketpair - socket - signals - file I/O - shared memory