CS 3733 Operating Systems, Spring 2009 Diagnostic Exam 1 Comments
- ret is an integer variable.
It cannot contain a string.
- NULL prepresents a pointer value.
It should not be used for integer variables.
- Read the questions and answer what is asked.
You should know what is meant by the word list.
- It is not an error if read or write return a value
less than what is asked as long as the value is not -1.
See your answer to question 3.
- Sometimes you need to take action, even if no error is produced,
for example, in b) when the return value is 1.
- In a), the return value might be 1 and this i what you want.
-
- -1, 0, 1, 2 or 3.
- -1, 1, or 2.
-
- 0, 1, 2 or 3.
- 1, or 2.
- In either case an error occurs if the return value is -1.
In this case an error message can be displayed
using perror or gotten using strerror.