GATE CS System Calls questions
Practise System Calls questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.
Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.
14 on this page
Consider the following program snippet. Assume that the program compiles and runs successfully. Further, assume that the fork() system call is always successful in creating a process. int main () { int i; for (i = 0; i < 3; i++) { if (fork() == 0) { continue; } break; } printf("Hello!"); return 0; } The total number of times that the printf statement gets …
Consider the following code snippet using the fork () and wait () system calls. Assume that the code compiles and runs correctly, and that the system calls run successfully without any errors. int x=3; while (x>0){ fork (); printf("hello"); wait (NULL) ; X-- ; } The total number of times the printf statement is executed is __________.
Which one or more of the following options guarantee that a computer system will transition from user mode to kernel mode?
Which of the following standard library functions will always invoke a system call when executed from a single-threaded process in a operating system?
The following C program is executed on a Unix/Linux system : #include<unistd.h> int main() { int i; for(i=0; i<10; i++) if(i%2 == 0) fork(); return 0; } The total number of child processes created is ________________ .
The following are some events that occur after a device controller issues an interrupt while process is under execution. P. The processor pushes the process status of onto the control stack Q. The processor finishes the execution of the current instruction R. The processor executes the interrupt service routine S. The processor pops the process …
A process executes the code fork(); fork(); fork(); The total number of child processes created is
A computer handles several interrupt sources of which of the following are relevant for this question. Interrupt from CPU temperature sensor (raises interrupt if CPU temperature is too high) Interrupt from Mouse (raises Interrupt if the mouse is moved or a button is pressed) Interrupt from Keyboard (raises Interrupt if a key is pressed or released) Interrupt …
A process executes the following code for(i=0; i<n; i++) fork(); The total number of child processes created is
Consider the following code fragment: if (fork() == 0) { a = a + 5; printf("%d, %p n", a, &a); } else { a = a - 5; printf ("%d, %p n", a,& a); } Let be the values printed by the parent process and be the values printed by the child process. Which one of the following is TRUE?
A processor needs software interrupt to
Which of the following devices should get higher priority in assigning interrupts?
When an interrupt occurs, an operating system
The details of an interrupt cycle are shown in figure. Given that an interrupt input arrives every msec, what is the percentage of the total time that the CPU devotes for the main program execution.
