ExamVeda
Login
Home
41
A user issues the following command sequence:
    $ a.out &
    $ bash
    $ a.out &
If the user kills the bash process, then which of the following is true?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
42
What this program is not able to connect with any client program?
#include<stdio.h>
#include<sys/types.h>
#include<sys/un.h>
#include<sys/socket.h>
 
int main()
{
    struct sockaddr_un add_server, add_client;
    int fd_server, fd_client;
    int len;
    char ch;
    fd_server = socket(AF_UNIX,SOCK_STREAM,0);
    if(fd_server == -1)
        perror("socket");
    add_server.sun_family = AF_UNIX;
    strcpy(add_server.sun_path,"demo_sock");
    if( bind(fd_server,(struct sockaddr*)&add_server,sizeof(add_server)) != 0)
        perror("bind");
    len = sizeof(add_client);
    fd_client = accept(fd_server,(struct sockaddr*)&add_client,&len);
    printf("Examveda\n"); 
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
43
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;
    int value;
    sem_id = sem_open("sem_value",O_CREAT,0666,0);
    if(sem_id == SEM_FAILED)
        perror("sem_open");
    if(sem_getvalue(sem_id,&value) == -1)
        perror("sem_getvalue");
    printf("%d\n",value);
    sem_wait(sem_id);
    printf("Examveda\n");
    if(sem_close(sem_id) == -1)
        perror("sem_close");
    return 0;
}
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
Which one of the following is not true?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What is the output of this program?
#include<stdio.h>
#include<pthread.h>
 
void *fun_t(void *arg);
void *fun_t(void *arg)
{
    printf("Example\n");
    pthread_exit("Bye");
}
int main()
{ 
    pthread_t pt;
    void *res_t;
    if(pthread_create(&pt,NULL,fun_t,NULL) != 0)                
        perror("pthread_create");
    return 0;
}
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
46
The process which terminates before the parent process exits becomes
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
47
Which one of the following is not a valid shell variable?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
48
Which call to use to set the resource count of semaphore?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
49
The command "make demo" will
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
50
The command 'ulimit'
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board