⟩ The signal sent to a process when the Ctrl-C key is pressed is a) KILL b) TSTP c) TERM d) INT
d) INT
d) INT
What is the output of this program? #include<stdio.h> #include<stdlib.h> int main() { int *ptr1; while(1){ ptr1 = malloc(1024*1024); if(ptr1 == 0) break; sleep(1); printf("googlen"); free(ptr1); } return 0; } a) it will print "google" until the process has been stopeed by any signal b) it will print nothing c) segmentation fault d) none of the mentioned
What is the output of this program? #include<stdio.h> #include<stdlib.h> int main() { int *ptr1, *ptr2; ptr1 = malloc(4); *ptr1 = 10; *ptr2 = free(ptr1); printf("%dn",*ptr2); return 0; } a) 10 b) it will print the address stored in ptr1 c) it will print the address stored in ptr2 d) it will give an error
Do you have any idea what is the output of this program? #include<stdio.h> #include<stdlib.h> int main() { int *ptr; *ptr = 10; *ptr = 20; printf("%dn",*ptr); return 0; } a) 10 b) 20 c) segmentation fault d) none of the mentioned
What is the output of this program? #include<stdio.h> int main() { int *ptr; ptr = (int *)calloc(1,sizeof(int)); *ptr = 10; printf("%dn",*ptr); return 0; } a) 0 b) -1 c) 10 d) none of the mentioned
On Linux, initrd is a file a) containing root file-system required during bootup b) Contains only scripts to be executed during bootup c) Contains root-file system and drivers required to be preloaded during bootup d) None of the above
Which of the following is not a valid run-level? a) S b) 0 c) 8 d) 1
Which file is read by init to get the default run-level? a) /etc/profile b) /etc/init c) /etc/boot d) /etc/inittab
Which is loaded into memory when system is booted? a) Kernel b) Shell c) Commands d) Script
Which signal is generated when we press control-C? a) SIGINT b) SIGTERM c) SIGKILL d) SIGSEGV
If a signal is received by a process, when will it be processed? a) It is processed immediately b) It is processed when process is switching to kernel mode c) It is processsed in the next timeslice given to the process