Quiz Space

Operating Systems · Quiz 2 · 24 Mar 2024 · January 2024 term

Question 3: Consider the code given below. While the execlp("ls", "",…

Question 3

+2 marksOne correct option

Consider the code given below.

c
int pid;
pid = fork();
if (pid > 0){
pid = wait();
}else{
execlp("ls", "", NULL);
exit(0);
}

While the execlp("ls", "", NULL) function is running in the child process, what is the state of the parent process?

  1. A

    Sleeping

  2. B

    Running

  3. C

    Terminated

  4. D

    Waiting

Show answer

Correct answer

  • A

    Sleeping

Question 3 of 19 in the IIT Madras BS Operating Systems (Operating Systems) Quiz 2 paper sat on 24 Mar 2024, in the January 2024 term (IIT M FOUNDATION AN EXAM QDF2 24 Mar 2024). It carries 2 marks.

More questions from this paper

  1. Q1Given the hexadecimal view of first few bytes of different files, identify the executable file (ELF file) from the opti…
  2. Q2Figure question
  3. Q4Figure question
  4. Q5Which of the following best describes the role of the Programmable Interrupt Controller (PIC) in the xv6 operating syst…
  5. Q6A situation where several processes access and manipulate the same data is referred to as .
  6. Q7What system calls are commonly used for communication in message passing?
  7. Q8Consider the partial help message from the readelf utility Match the following. a) Linker view    1) readelf …
  8. Q9What is the correct sequence of tasks that takes place as part of hardware interrupt handling? (i) Process the interrup…
  9. Q10Figure question
  10. Q11Select the path traced in case of a timer interrupt caused while in the supervisor mode in xv6.
  11. Q12Figure question
  12. Q13Figure question
  13. Q14Assume that two processes P1 and P2 are sharing a variable. If P1 can go into critical section when the P2 is in the cr…
  14. Q15Round Robin provides the same or a lower response time compared to First-Come-First-Serve (FCFS) scheduling algorithm.
  15. Q16Figure question
  16. Q17Consider the following code snippet from Bakery Algorithm. critical section Considering there are 4 processes, and init…
  17. Q18Assuming context switches can occur at any time during the execution of the following code snippet, counter is a shared…
  18. Q19Consider the following scenario where two processes are sharing a common variable. Global setup Process 1 Process 2 Sel…