1. One process forks another one with fd #0 open for reading, but the child process doesn't know whether the fd is for a pipe, a stream socket, a disk file, or a terminal. (There are ways to find out which, but we don't need that information.) Answer these questions:
    1. Assume the fd is for a SVR4 pipe. Answer questions 1a through 1e below.
    2. Assume the fd is for a stream socket. . Answer questions 1a through 1e below.
    3. Assume the fd is for a terminal. Answer questions 1a through 1e below.
    4. Assume the fd is for a disk file. Answer questions 1a through 1e below.

    1a. What would cause end of file to be reached on the fd?

    1b. How would the child process detect end of file?

    1c. Under what condition would a call to read() return a value greater than zero, but smaller than the number of bytes that the process requested?

    1d. Under what condition would a call to read() return a value of negative one?

    1e. Under what condition would a call to read() return a value of zero?

  2. A process has two fds open for reading and wants to read from whichever one is ready for reading first. How can this be done? Give as many details as you can.

  3. Here are some RCS questions:

    3a. What does the "-l" option do on a co command?

    3b. The last revision of myprog.cc was number 2.7 and I just made some changes to it that are part of revision level 3. How do I check the file in?

    3c. The last revision of x_file.cc was number 7.2. There are no changes to it for revision level 8, but it is used in revision level 8. What should I do? (Note: "Ask Dr. Vickery" is not an acceptable answer!)

    3d. What does the line, "static char *rcs_version = $Id$;" have to do with the ident command?

    3e. I made a mistake typing the log message when I checked in a file. How can I fix it?

  4. Define the following make terms: Implicit rule, Explicit rule, target, dependency list, command list. After defining them, use them to describe what make does.

  5. Describe three ways to provide a value for the make macro, CXXFLAGS. ("Describe" means to say more than just to name the ways!) Then tell how make uses the CXXFLAGS macro. Then tell what will happen if there is no value assigned to the CXXFLAGS macro when it is used by make.

  6. A. Describe as many ways as you can that datagram sockets are different from stream sockets.

    B. Describe as many ways as you can that datagram sockets are like stream sockets.


Christopher Vickery
Computer Science Department, Queens College of CUNY