CS 3733 Operating Systems, Spring 1997 Assignment 1
Due Tuesday, February 4
Do Exercise 2.14 from page 72 of PUP with the following modifications.
All of the parts of this project should be put in a single directory
off of your home directory which contains only the files relevant to
this assignment. Before starting the assignment, read the instructions
for handing it in. Recall that all assignments are due at the beginning
of class on the due date. Do not modify the source or executables
after the due date. You must keep these available at least until
your assignment has been graded. Be prepared to demonstrate your programs.
Part 1
Do the first 7 bullets on page 72. The last one starts with the
word "Beware." Make a makefile for compiling and linting your
program. Typing:
make lint
should run lint on your program.
Part 2
Do bullet number 8, calling the source program mybiff2.c.
Keep the copy of your program from Part 1 with the name mybiff.c.
Modify your makefile so that it will make both programs. Typing:
make lint2
should run lint on this part.
Part 3
Do the next bullet, calling the program mybiff3.c.
Modify your makefile so that it will make and lint this program also.
Read Section A.1.2 starting on page 583 of PUP for
information on command-line arguments.
Read the man page for getopt to learn how to use it.
(Use man -s 3C getopt).
Part 4
The man page for getopt lists its MT-LEVEL as Unsafe.
Explain why it would not be possible to write a MT-SAFE version of
getopt which used the same syntax.
Handing in your assignment
You will hand in the following:
- the cover sheet which can be printed from the file /usr/local/courses/cs3733/spring97/cover1.ps
- source code for Parts 1, 2, and 3.
- lint output for Parts 1, 2, and 3.
- the answer to Part 4.
All pages should be numbered consecutively with the cover sheet as page 1.
Fill in the cover sheet with the page numbers of the various parts of your
assignment. The answer to part 4 should be on the very last page.
All source code should be printed with 2 pages per side. You can do this using
prtext.