CSCI 310 Final Exam Spring 2015
- The weight for each question is given with the question.
- Use as much paper as you wish, but make your answers are legible.
- Please answer each question thoughtfully and carefully.
- Make sure that your name is on the first page of your test.
- When asked for code snippets, give variable declarations (when appropriate) but do not include (unless specified)
- Header files
- main routine
- Full parameter lists
- Other standard programming details.
Simply provide sufficient code to illustrate the concept.
- API
- [4 points] Give two different examples of where the Unix/Linux API has changed since it was created.
- [4 points] Explain these changes in the API. What was different and why?
- [2 points] Why have these changes occurred?
- [5 points] The Unix/Linux exhibits a universality of I/O. What does this mean? How is this manifested in the API? (Give examples)
- Files
- [4 points] Describe the relationship between the file descriptor table, the open file table and the inode table.
- [3 points] Is it possible for two different processes to both point to the same entry in the open file table? How or why not? Given a plausible explanation or series of system calls.
- [3 points] Is it possible for two entries in the open file table to point to the same entry in the inode table. How or why not? Given a plausible explanation or series of system calls.
- Password files:
- [3 points] Describe how the password and shadow password files are employed when a user logs in.
- [5 points] Provide a section of code, including system calls, that a login daemon would employ to start a user's initial shell. This should include the calls to obtain necessary information and start required processes.
- [2 points] Why is the file name not stored in the inode for a file?
- [5 points] Compare and contrast symbolic links and hard links.
- [5 points] Describe the action performed by each of the following system calls:
- Socket
- Bind
- Listen
- Accept
- Connect
- [5 points] Our author states that a daemon should close all file descriptors, including standard in, standard out and standard error, and then reopen the three listed as /dev/null. Why? (This is not a single idea answer).