⟩ Which filesystem can be used to change certain kernel parameters at runtime using sysctl command? a) Ext3 b) Sysfs c) Ext4 d) Procfs
d) Procfs
d) Procfs
In which condition this prgram will print the string "google"? #include<stdio.h> #include<stdlib.h> int main() { int *ptr; ptr = (int *)malloc(sizeof(int)*10); if (ptr == NULL) printf("googlen"); return 0; } a) if the memory could not be allocated to the pointer "ptr" b) if the memory has been allocated to the pointer "ptr" successfully c) it will never print d) none of the mentioned
What is the output of this program? #include<stdio.h> #include<stdlib.h> int main() { int ret; int *ptr; ptr = (int *)malloc(sizeof(int)*10); free(ptr); free(ptr); return 0; } a) it will print nothing b) it will give segmentaion fault c) undefined behaviour d) none of the mentioned
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