CS-701 Midterm Exam, Spring 1995

1. What do the terms system time and user time refer to? Define system call and library call, and tell how these terms relate to system time and user time.

2. Which executes more quickly, getc() (a macro) or fgetc() (a library function)? Explain your answer.

3. Which executes more quickly, read() or getc()? Explain your answer.

4. Tell how to back up your work onto a floppy disk in the lab.

5. Tell how to use gdb to perform the following operations:

A. Start debugging an executable program named myprog.

B. Run the executable program without intervention until it reaches a function named myfunc.

C. Display the value of a variable named myvar.

D. Continue execution from a breakpoint.

E. Exit the debugger.

6. List the processing programs that may be invoked by a compiler driver such as gcc and tell what each program does in terms of the contents of the file(s) that it reads and the file(s) that it writes.

7. Tell what each of the following compiler driver command line arguments does:

-c, -D, -g, -I, -L, -l, -o

8. Tell the relationships among header files, function prototypes, and library files.

9. A. Describe all the parameters that are received by the main() function and tell what value it returns.

B. Relate your answer to Part A to the arguments to execve().

10. Tell what arguments are passed to and returned by the fork() and wait() system calls; tell what each does.



Dr. Christopher Vickery
Computer Science Department
Queens College of CUNY