CS 3733 Operating Systems, Spring 2005 Assignment 4


Due Friday, April 15, 2005

Part 0:
Make sure you have Parts 4 and 5 of Assignment 3 working.

Part 1:
Modify your server from part 4 of Assignment 3 so that it will work when signals are caught. Make sure all of the system calls restart when a signal is delivered. Use the restart library.

Have the server start by displaying a line containing its process ID. Write a signal handler that just prints a message (to standard error) indicating that the signal was caught. You may assume that it is safe to use fprintf inside the handler.

Have the server catch SIGUSR1 using the handler above. Test your program by sending signals to the server from another window while the client and server are communicating.

Part 2:
Have the server keep track of the number of files it processed and the total size of all of these files. Remember that it processes one file by sending three lines to the client. Modify the signal handler so that it displays this information when a signal is caught.


Handing in your program:
Use this cover sheet. Consecutively number all of the other pages you turn in. Each page that contains your work should have a number on it. Turn this in at the beginning of lecture on the due date. In testing Part 2, be sure to send at least 3 signals to the server, one before the client communicates and 1 after each of two runs of the client (without restarting the server). Save the output from both the client and the server.