CS 3733 Operating Systems, Fall 2001 Assignment 5


Due Wednesday, November 21, 2001


Introduction
This is a short continuation of Assignment 4 in which you use signals to obtain information about the musicinfo program while it is running.

Part 0:
Copy all of your programs from Part 4 of Assignment 4 into a new directory. Keep all of your programs from Assignment 4 in case you have to demonstrate them separately.

Make sure your musicinfo program is working correctly and handles the restarting of system calls that are interrupted by a signal.

Part 1:
Have musicinfo start by displaying its process ID. Add a signal handler to musicinfo for SIGUSR1. When the signal comes in, send to standard error printable text containing the number of commands received of each type: 0, 1, 2, 3, or invalid, followed by the current database. To output the database, add a new function to datalib:
void printdataerr();
This is just like printdata except that it sends its output to standard error, rather than standard output.

You may assume the the fprintf and related functions are async-signal-safe.

Handing in the program
Hand in the program just as for Assignment 4, but use one extra window.
Use this extra window to send a SIGUSR1 signal to musicinfo each time you send it some data from another window.
Use this cover sheet.