51. Accessing the file /proc/meminfo gives the different result each time because
52. The assmebly code generated depends upon the
53. UNIX/Linux kernel is?
54. What is the output of this program?
#include<stdio.h>
#include<pthread.h>
#include<fcntl.h>
void *fun_t(void *arg);
void *fun_t(void *arg)
{
pthread_exit("Bye");
printf("Example\n");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
perror("pthread_create");
if(pthread_join(pt,&res_t) != 0)
perror("pthread_join");
printf("%s\n",res_t);
return 0;
}
#include<stdio.h>
#include<pthread.h>
#include<fcntl.h>
void *fun_t(void *arg);
void *fun_t(void *arg)
{
pthread_exit("Bye");
printf("Example\n");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
perror("pthread_create");
if(pthread_join(pt,&res_t) != 0)
perror("pthread_join");
printf("%s\n",res_t);
return 0;
}
55. Which one of the following GDB command allows to move from one stack frame to another without printing the frame?
56. Deleting a soft-link
57. Indicate the right option to search for anything not a letter or number
58. In this program, the third argument of the socket() is used for . . . . . . . . potocol.
#include<stdio.h>
#include<sys/types.h>
#include<sys/socket.h>
int main()
{
int fd_socket;
if(socket(AF_UNIX,SOCK_STREAM,0) == -1)
perror("socket");
return 0;
}
#include<stdio.h>
#include<sys/types.h>
#include<sys/socket.h>
int main()
{
int fd_socket;
if(socket(AF_UNIX,SOCK_STREAM,0) == -1)
perror("socket");
return 0;
}
59. In linux, shared library is a
60. What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
int main()
{
sem_t* sem_id;
sem_id = sem_open("sem_value",O_CREAT,0666,0);
if(sem_id == SEM_FAILED)
perror("sem_open");
sem_wait(sem_id);
printf("Example\n");
if(sem_close(sem_id) == -1)
perror("sem_close");
return 0;
}
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
int main()
{
sem_t* sem_id;
sem_id = sem_open("sem_value",O_CREAT,0666,0);
if(sem_id == SEM_FAILED)
perror("sem_open");
sem_wait(sem_id);
printf("Example\n");
if(sem_close(sem_id) == -1)
perror("sem_close");
return 0;
}
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.