CSCI 311 Test 1 Spring 2017


  1. (6 points) Name and describe three distinct tasks performed by the linux kernel.
  2. Program Kernel Interaction
    1. (3 points) What is a system call?
    2. (2 points) What is a library function?
    3. (2 points) Give an example of a system call and a library function. Label each clearly.
  3. Errors.
    1. (2 points) How can a programmer determine if an error has occurred during a system call?
    2. (3 points) What utilities exist to help the programmer communicate to the user the error that has occurred during a system call.
  4. (8 points) There are four basic system calls associated with performing file I/O. Name and describe each.
  5. (3 points) Describe the actions performed by int dup2(int oldfd, int newfd);
  6. I/O Redirection.
    1. (2 points) Describe what the following command does at the I/O level who | more
    2. (4 points) Draw a diagram showing the execute of these programs, including the shell, over time. Include labels such as fork, exec, and wait. Also include the process names.
    3. (6 points) Provide the code, including system calls, which the shell might use to accomplish the above task. You do not need to have the parameters to the system calls completely correct.
  7. (2 points each)The File System
  8. (1 point each) Name three different types of files on the linux file system.