⟩ Which one of the following command creates the executable file a.out? a) gcc -o google.c b) gcc google.c c) gcc -o a.out d) gcc a.out
b) gcc google.c
b) gcc google.c
What is a context switch? a) Kernel switches from executing one process to another. b) Process switches from kernel mode to user mode. c) Process switches from user mode to kernel mode. d) None of the above
What is the default maximum number of processes that can exist in Linux? a) 32768 b) 1024 c) 4096 d) unlimited
Which option of rmdir command will remove all directories a, b, c if path is a/b/c a) -b b) -o c) -p d) -t
How do you get parent process identification number? a) waitpid b) getpid() c) getppid() d) parentid()
Pid of init process a) 0 b) 1 c) 32767 d) none of the above
How many times printf() will be executed in the below mentioned program? main() { int i; for (i = 0; i < 4; i++) fork(); printf("my pid = %dn", getpid()); } a) 4 b) 8 c) 16 d) 32
What is output of the following program? int main() { fork(); fork(); fork(); if (wait(0) == -1) printf("leaf childn"); } a) "leaf child" will be printed 1 times b) "leaf child" will be printed 3 times c) "leaf child" will be printed 4 times d) "leaf child" will be printed 8 times
What is the output of the below code? void exit_handler1(); void exit_handler2(); int main() { int pid; atexit(exit_handler1); atexit(exit_handler2); pid = fork(); if(pid == 0) { _exit(0); } else { sleep(2); exit(0); } return 0; } a) Only child executes the exit_handler 1 and 2. b) Only parent executes the exit_handler 1 and 2. c) Both parent and child executes the exit_handler 1 and 2. d) Neither parent nor child executes the exit_handler 1 and 2.
The maximum time slice that can be given to a process in Linux (where tick is 10ms) is a) 150ms b) 10ms c) 300 ms d) 600ms
The process which terminates before the parent process exits becomes a) Zombie b) Orphan c) Child d) None of the above