CS 3733 Operating Systems, Spring 2005 Assignment 4 Comments
General Comments:
- This assignment was graded on the basis of 30 points.
- Learn to use lint.
From the comments on assignment 1:
Each main program is linted with all of the pieces needed to run it.
To run lint on the client program:
lint FIFO_client.c utility.c restart.c
I do not understand why people still cannot do this.
- A lint warning that sometimes return values are ignored is usually OK,
but not in the case of strlen.
- You don't need to declare something as volatile just because it is used
in a signal handler, only if it is changed in the handler.
- Do not use the signal system call.
- Save and restore errno in the signal handler if you are using
print.
This calls the lower level Unix functions (like write) which
might change errno.
- If you are reading a variable in a signal handler, you should block the
signals which changing the value of that variable unless it is of type
sig_atomic_t. You cannot use this to safely store large
values (like the size of a file).