Solutions to HW 8 ------------------ 1. There are a total of four processes involved in this program. Let us call the given process, initiated by executing the program, as P1. P1 will fork off a process (call it P2). Then both P1 and P2 proceed to execute from that point, and see the second fork() call. Both of them will fork over processes, P1 will fork over P3, and P2 will fork over P4. To summarize: P2's parent is P1. P3's parent is P1. P4's parent is P2. You will see five lines of output. All four processes will print a "bye" (this should have alerted you to the possibility of four processes). Only one will print "hello", namely P4. The process that prints "hello" is the only process that doesn't have a child (since the fork() call for all others will return the child's process ID). 2. You will learn that open file descriptors are duplicated across fork() calls. In other words, when one process writes into the file, the file pointer is updated in both parent and child processes.