CS 284 Operating Systems
Programming Assignment #4

Due: 2/2/2001 - Class Time

Write a C program that performs a printf(..) describing all significant events during the execution of the following outline:
int main()
{
    what is my pid and my parent's pid
    fork()
    was it successful?
    the new child process should
    {  announce its birth
        what is its pid and its parent's pid
        sleep a couple seconds
        announce its impending death
        exit
    }
    the parent should announce the creation of a child process
    tell the child's pid
    system("ps -al");
    wait for the child to die                   <---------'A' section.  I may have not mentioned this in class
    announce the child's death
    exit or return
}
=================================================================

You will use the 'script' command to capture all necessary information for handin.

After you have generated the 'script' file, edit it by adding a comment to each line generated by
the system(...) call noting what each of the processes corresponds to in terms of your program.