Comp111 - Quiz 1
Oct 4, 2017 - closed book
Please fill in the blanks. Each blank is worth 5 points.
There are several reasonable answers for some of the blanks; choose one.
Blanks with the same number have the same answer.
- The operating system sends ________signals________ to processes to inform them of state changes. To send one of these, a process can use the ________kill________ system call.
- When measuring the time for a process, ________user________ time is the time spent inside the process, while ________system________ time is time spent inside the operating system on behalf of the process.
- When creating a child process, the only difference between the parent and the child is the return value of ________fork________. When a child exits, it returns a ________status code________ to the parent. If the parent does not read this, the child becomes a ________zombie________.
- Signal handlers can be called at any time, so that they utilize a different ________stack________ to avoid confusion. This allows signals to interrupt ________other handlers________ as well as the regular program. This is called "signal stacking".
dup on a file descriptor makes a copy of it using the ________lowest________ descriptor that is not open.
- A pipe is a(n) ________(kernel) buffer________ represented by an array of two file ________descriptors________, one for the write side and one for the read side.
- The point of write buffering is to minimize ________system
calls_________ according to one of three buffering strategies.
For example, ________line________ buffering calls a system call
only when the user types ________the return character________. One can force a
system call by ________flushing________ the buffer. If one exec's
another program before doing this, pending output is
- The reason we pass so many pointers to an operating system as type _______void *________ is that the operating system has no reason to know the real type.
- To glue the output of process one to the input of process two,
one opens a pipe and dups its write side to the file descriptor with
number ________1________ on process one, and dups its read
side to the file descriptor with number ________0________ on
- (Extra credit) The only difference between the memory maps for a thread and a process is that a thread has its own ________stack________.