Please fill in the blanks. Each blank is worth 5 points.
struct bar *foo(const struct dog *);and a function pointer
void *(*p)(const void *);Then we can assign the value of
ponly via a type cast
p = (____(void *)(*)(const void *)____) foo;This kind of cast is necessary for starting up a ____thread____, because one wants to pass it an argument of ____unknown/arbitrary/variant____ type.
pid = wait3(&status,0,&rusage);
pidis the process identifier of the last process that ____exited/terminated____, while status is that process's ____exit code____.
pid = fork();creates two copies of a program. In the parent,
pidis the identifier of the ____child____, while in the child,
pidis ____0____. Failure to flush a formatted I/O output buffer before a
forkcan lead to ____duplicate/redundant/extra____ output.
execl("/usr/bin/foo", "/usr/sbin/bar", "cat");does the same thing as typing ____/usr/bin/foo cat____ on the command line. It replaces all ____user____ memory with that contained in the new program, but leaves ____kernel____ memory largely alone. Among other things, the program's ____environment____ variable values and I/O ____descriptors____ are preserved after an
getrusageare part of the ____process control block____ stored in kernel memory.