51.
Accessing the file /proc/meminfo gives the different result each time because

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;
}

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;
}

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;
}

Read More Section(Linux)

Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.