91. The library contains the
92. In GDB breakpoints can be skipped by the command
93. What is the meaning of $ sign in awk programming?
94. What will be printed for the command below?
$ grep –c “^echo” abc
$ grep –c “^echo” abc
95. What is the output of the below code?
void sig_handler ( int signum) {
printf(“Handled the signal\n”);
}
int main() {
int pid;
signal (SIGKILL, sig_handler);
pid = fork();
if (pid==0) {
kill(getppid(), SIGKILL);
exit(0);
} else {
sleep(20);
}
return 0;
}
void sig_handler ( int signum) {
printf(“Handled the signal\n”);
}
int main() {
int pid;
signal (SIGKILL, sig_handler);
pid = fork();
if (pid==0) {
kill(getppid(), SIGKILL);
exit(0);
} else {
sleep(20);
}
return 0;
}
96. Which option of the gcc is used to warn is padding is included in structure?
97. What is the output of this program?
#include<stdio.h>
#include<signal.h>
void response (int);
void response (int sig_no)
{
printf("%s\n",sys_siglist[sig_no]);
}
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1:
perror("fork");
case 0:
break;
default :
signal(SIGCHLD,response);
wait(&status);
break;
}
}
#include<stdio.h>
#include<signal.h>
void response (int);
void response (int sig_no)
{
printf("%s\n",sys_siglist[sig_no]);
}
int main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1:
perror("fork");
case 0:
break;
default :
signal(SIGCHLD,response);
wait(&status);
break;
}
}
98. Fork returns . . . . . . . . to parent process on success
99. cmd 2>&1 > abc will
100. This program will allocate the memory of . . . . . . . . bytes for pointer "ptr".
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int*)malloc(sizeof(int)*4);
ptr = realloc(ptr,sizeof(int)*2);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int*)malloc(sizeof(int)*4);
ptr = realloc(ptr,sizeof(int)*2);
return 0;
}
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.