CS 3733 Operating Systems, Fall 1996 Assignment 3


When turning in assignments use the cover sheet that will be provided and make sure that the cover sheet is completely filled in.


Part 1:
From PUP, section 4.1 starting on page 147:
Do all parts except for the last two (bidirectional ring and torus). Modify the first program (called ring.c so that it starts by printing a message to standard error in the form:
This program was written by ...
and modify the message printed out by each process so that it prints its child process ID also:
This is process n with ID x, parent ID y, and child ID z
If the process has no child, it should print -1 for the child ID.

You can get a copy of the original ring.c that is in the text from /usr/local/courses/cs3733/pup/ch04.

When capturing sample output do not use redirection. This will affect the behavior of some of the programs. Use cut and paste to pick up the output to your screen.

In preparing your packet to be handed in be sure you do the following:

  1. Include your makefile.
  2. Include source code for each part clearly labeled.
  3. Include lint output for each part clearly labeled.
  4. Describe the corrections needed to remove any lint errors.
  5. Include sample output from each of the parts and describe your observations.
  6. For ring1, how does it affect the output?
  7. For ring2, how does it affect the output?
  8. For ring3 include sample output and describe it in your own words. Make sure you use a large enough value of the second parameter.
  9. For ring4 include sample output and describe how this differs from ring3.
  10. For ring5 include sample output and describe how this differs from ring3.
  11. For the last part, call the program ring6 and include sample output and describe the results. Are they what was expected?

Part 2:
Write the following function:
int wait_for_news_to_come_in(char *path, char *grp, int recheck, int timeout) This function checks the given newsgroup and returns an integer status.
The possible return values are: The funtion will get the modification time of the newsgroup and then recheck it every recheck seconds. It returns if there has been a change in the modification time. If no change has been detected after timeout/recheck attempts, the function should return.

Write a driver to check to see that your function is working correctly.

Now copy ring.c into newsbiff.c and modifiy it as follows:

You can test your program on a subdirectory from your account since there is nothing special about the news system that is used by this assignment. Be prepared to demonstarte that your program actually works. Part of your grade will be based on the method used to test your program.