Assignment 2, due Jan. 30
Always, on every assignment, please write your name legibly as it appears on your University ID and on the class list! All assignments will be due at the start of class on the day indicated (usually a Friday). The only exceptions to this rule will be by advance arrangement unless there is what insurance companies call "an act of God" - something outside your control. Homework must be turned in on paper and in class! Late work may be turned in to the teaching assistant's mailbox, but see the late work policy. Never push late work under someone's door!
a) There are 4 #include directives. Each of them makes some of the function calls in the program legal. Which functions does each include directive make legal? An empirical approach may be the easiest way to answer this -- see what error messages result from deleting each #include directive. (0.5 points)
b) The code exit(0) is used to exit the shell when it hits an end-of-file or when it encounters an exit command. The Unix standard discourages using this naked constant, and recommends that exit() be called with specific symbolic constants indicating success and failure. What are the recommended constants and which header file are they in? Hint: It's the same header file that allows you to call exit() in the first place. (0.5 points)
# script script | script
a) What does it do? Answer this by reading the text. (0.5 points)
b) Why, on early Unix systems, did it crash the system? Trying it might help answer this. (0.5 points)