1. For each of the following system calls or library functions, tell what arguments the function receives, what value it returns, and what the function accomplishes.

  1. fork
  2. exec
  3. wait
  4. signal
  5. kill
  6. alarm
  7. open
  8. read
  9. fopen
  10. fread

2. This question is the same as #1 for mmap(), but I am giving you "the format of the call" as it is given in the man page:

pa = mmap(addr, len, prot, flags, fildes, off);

3. Draw a diagram that shows the segments of a process' virtual memory, then answer the following questions about:

in the program below:

  1. What virtual memory segment does it occupy.
  1. What is its scope. (i.e., what parts of the program can access it.)
  2. When does it come into existence.
  3. When does it go out of existence.

#include <stdlib>

int u

static int v

int foo(int w) {

int x;

static int y;

int* z = malloc(sizeof(int));

}

4. Describe what is found in the /proc and /usr/proc/bin directories.


Christopher Vickery
Queens College of CUNY