Midterm Fall 2001

Midterm Fall 2001 - Midterm Fall 2001 Name 1 Answer...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Midterm Fall 2001 Name: 1. Answer True/False (T/F) (1 point each) _ F__ The size in bytes of a variable of type (char *) is 1 byte. _T__ In a C program the expressions a[i] and *(a + i) are equivalent. _T__ The strdup function calls malloc. _F__ On a 1-CPU computer, a program that runs in time T will run in time T/n if decomposed in n threads. _F__ The "S" in SMP stands for Simultaneous. _F__ A call to "strcmp" will show in the truss output. _T__ The time command in mentor could show that the user time is larger than the real time. _T__ A long time quantum may cause a program to finish sooner. _T__ The arguments of a system call are checked in kernel mode. _F__ The file descriptors of a process are closed when a process calls execvp(). _T__ A process that uses pipes may hang due to unclosed file descriptors. _T__ A program that runs with non preemptive scheduling runs faster than one with preemptive scheduling. _F__ Most of the processes' CPU bursts do not finish before a context switch. _F__ Programs that run round-robin scheduling have faster average response time than programs that run SJF. _F__ When a process calls fork, the number of open file objects in the kernel is duplicated. _F__ POSIX threads are better than Solaris threads because the former are faster. _T__ The input/output redirection to files can be done by the child. _T__ Kernel threads in a process share the same file descriptors. _F__ A section of code that is guarded by sema_wait/sema_post calls can be executed by only one thread at a time. _F__ A process table entry contains one set of registers for each user and kernel level thread in a process. 2. (3 pts.) Enumerate the fields of a process table entry Process ID Process state Saved Registers File Descriptors Page Table
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
3. (3 pts.) Mention the checks done by the kernel during the open() system call.. File Permissions: If the file is opened in write-mode, the user should have write permissions to the file either as user, group or others. The same for read-mode. If fthe file is opened with the flag O_CREAT and the file does not exist, the user should have write permisisons to the directiory the file will be created into.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern