Comp111 - Quiz 1 review 2

Oct 6, 2009 - closed book



Please fill in the blanks. Each blank is worth 5 points.

  1. The difference between signal(2) and sigaction(2) is that signal only allows one to set the ________1________ for a specific signal, while sigaction allows one to additionally specify the ________2________ and various other options. While signal is deprecated, sigaction is part of the POSIX standard. This means that code that utilizes sigaction is more likely to be ________3________ among several operating systems.
  2. The signal SIGINT corresponds to typing ________4________ on a keyboard. Signal SIGKILL tells a process to die ________5________. In the C call kill(547,SIGKILL); 547 is a ________6________ while the type of the value SIGKILL is ________7________.
  3. A signal handler must have the declaration
    void handler(________8________); 
    In passing that handler as a function argument, one declares the signal function as
    sighandler_t signal(int signum, sighandler_t handler);
    In this, sighandler_t is a ________9________ that represents "pointer to ________10________."
  4. In an operating system, the ________11________ handles nested or concurrent signals while the ________12________ handles subroutine calls.
  5. To read the contents of a directory in unix (e.g., /proc), one uses the ________13________ and ________14________ system calls.
  6. The context of a process contains value for the program counters and other ________15________ as well as a ________16________ of memory used by the program.
  7. The difference between a file descriptor and a file pointer is that a file pointer contains a ________17________ that stores information already read from the device but not yet consumed by the process.
  8. In /proc, the ________18________ parameter depicts time spent computing in the user's program, while the ________19________ parameter depicts time spent in system calls. The ________20________ parameter depicts the amount of physical memory in use by a process, not including virtual memory.