CS 3733 Operating Systems


Assignment 3: Batch Processor with Status Information

Due Date: October 8, 1997

This assignment relies on both Assignment 1 and Assignment 2. It will be checked off in the laboratory on the due date. Checkoff times will be announced. You must hand in complete source code, lint and sample output on the due date.

  • Before starting to write this assignment, read the following man pages: Try some of the functions described on the ptree man page to see how Sun presents proc information.

  • Write the following two functions that are analagous to the get_prstatus and the output_prstatus functions that you wrote for Assignment 2:

  • Write a function called trace_stopped which will output status information and usage information for a child process that has been stopped. If the child's state indicates that it has been terminated rather than stopped output a message to that effect. The waitpid must include WUNTRACED in the options in order to receive notification of a stopped process.
         int trace_stopped(FILE *fp, int pid, int stat_loc);
    

  • Modify your runsim so that it calls trace_stopped for each successful waitpid.

  • Test your program as before, but send SIGSTOP and SIGCONT signals from another window to children of runsim to cause status information to be output.
    Revision Date: 9/30/97