CS 3733 Operating Systems, Spring 2001 Assignments 6


Due Tuesday, May 1, 2001


This assignment is a continuation of Assignments 4 and 5.

You will need at least one port number for this assignment. So that your port number will not conflict with those of other students, port assignments are listed here.

Use this cover sheet for handing in Assignment 6.


Part 0
Make a directory called assign6 for all of the files for this assignment. Get a copy of the UICI code from /usr/local/courses/cs3733/uici_source. This contains a version of UICI in which the server will not hold onto the port number after it terminates. Included are the UICI source and sample client and server code. Compile these and make sure the client and server can communicate when run on different machines.


Part 1.
Copy all of the files needed to run syncsources and syncdest into your assign6 directory. Copy syncsources.c into syncdaemon1.c and syncdest.c into syncdir1.c.

Instead of taking two pipes as command line arguments, syncdaemon1.c will take a port number and use a network connection for the transfer. It will be a serial server.

Similarly, syncdir1.c will take a host name and a port number as command line parameters.

Test these in the same way you did Part 8 of Assignment 5, but log into a different machine for running syncdir1.c. Test that the signals still work with syncdaemon1

Do not run syncdaemon1 in the background. Make sure you do not leave any of these programs running when you log out.


Part 2.
Copy syncdaemon1.c into syncdaemon2.c and make in a parallel server which forks a child to handle the communication. Test this will at least two copies of syncdir1 running on two different machines (in two different directories).

Note: this is harder than it might first seem because of the statistics that need to be available using signals.


Part 3.
Copy syncdaemon2.c into syncdaemon3.c and modify it so that the first string it receives will be a directory. The program will then use this directory instead of the current directory. Do not allow a leading /, a .., or // to appear in the directory. If any of these occur, or the indicated directory does not exist, close the connection.

Copy syncdir1.c into syncdir2.c and modify it so that it take a third command line parameter, the name of the directory (on the remote machine) to send to syncdaemon3. Test these as before.


Part 4. (Optional)
Copy syncdaemon3.c into syncdaemon4.c and modify it so that if the first string it receives is "send status", It send all of the status information that would have been produced by both signals over the network to the remote machine. Send this information as printing characters and close the transmission. Eliminate all of the signal code from syncdaemon4.

Write a program called syncstatus than can be used to get this status information. Test this and produce annotated output to show that it is working.