{ "q1": { "type": "multiple", "question": "\n\n\nAfter a fork(), both the parent and the child processes are\nalmost exactly the same except they have different (choose all that apply):\n\n\n", "responses": { "registers": "Registers", "code": "Program code", "pid": "Process identifiers (PID)", "uid": "User identifier (UID)", "address": "Address spaces" } }, "q3": { "type": "multiple", "question": "\n\nWhat happens during an exec() system call (choose all that apply)?\n\n\n", "responses": { "process": "A new process is created.", "loads": "New program code is loaded.", "args": "The process is restarted with arguments passed in as argv.", "pid": "The process acquires a new PID.", "memory": "The stack and heap are re-initialized." } }, "q2": { "type": "multiple", "question": "\n\n\nIn Figure 5.2, what happens if we remove the else block on lines\n16 through 20 (choose all that apply)?\n\n\n", "responses": { "parent": "The parent will print first because it no longer has to wait.", "bomb": "This causes a fork bomb.", "crashes": "The program crashes because you should always have a wait.", "compiles": "The program no longer compiles because of the missing functions.", "child": "The child could become either an orphan or a zombie." } }, "q5": { "type": "blank", "question": "\n\n\nThe following code is meant to list all the regular files in the current\ndirectory. Fill in the blanks for the missing portions of code:\n\n
\nint main(int argc, char *argv[]) {\n    DIR *d = ____(____);\n    if (d) {\n        struct ____ *e;\n        while ((e = ____(d))) {\n            struct ____ s;\n            if (____(____, &s) == 0 && ____(s.st_mode)) {\n                puts(____);\n            }\n        }\n    }\n    ____(d);\n    return 0;\n}\n\n
\n\n
\n" }, "q4": { "type": "multiple", "question": "\n\n\nWhat are some reasons why programs such as Firefox or Chrome may\nperidiocally use the fsync system call (choose all that\napply)?\n\n\n", "responses": { "performance": "Regularly synchronizing the data improves performance.", "persists": "Regularly synchronizing better ensures that the data persists.", "cleans": "Regularly synchronizing prevents deadlocks.", "resources": "Regularly synchronizing frees up resources.", "crashes": "Regularly synchronizing prevents application crashes." } }, "q6": { "type": "blank", "question": "\n\n\nOn student00.cse.nd.edu, the root filesystem (i.e. /) is\nmounted from the ____ device and uses the ____ filesystem type.\n\n\n" } }