Q241
Open question $ a.out &
$ bash
$ a.out &
If the user kills the bash process, then which of the following is true?Select an option to see the answer and solution.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
996
Questions
13/50
Page
Pick an option on a question to see the right answer and solution.
Q241
Open question $ a.out &
$ bash
$ a.out &
If the user kills the bash process, then which of the following is true?Select an option to see the answer and solution.
Q242
Open question#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;
}Select an option to see the answer and solution.
Q243
Open question#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;
}Select an option to see the answer and solution.
Q244
Open questionSelect an option to see the answer and solution.
Q245
Open question#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;
}Select an option to see the answer and solution.
Q246
Open questionSelect an option to see the answer and solution.
Q247
Open questionSelect an option to see the answer and solution.
Q248
Open questionSelect an option to see the answer and solution.
Q249
Open questionSelect an option to see the answer and solution.
Q250
Open questionSelect an option to see the answer and solution.
Q251
Open questionSelect an option to see the answer and solution.
Q252
Open question#! /usr/bin/awk -f
BEGIN {
system("date")
print "example"
}Select an option to see the answer and solution.
Q253
Open question#! /usr/bin/awk -f
BEGIN {
a[1]="example"
a[2]="example"
for(i=1;i<3;i++) {
print a[i]
}
}Select an option to see the answer and solution.
Q254
Open questionSelect an option to see the answer and solution.
Q255
Open questionSelect an option to see the answer and solution.
Q256
Open question#! /usr/bin/awk -f
BEGIN {
a=int(2.5)
print (a*20)
}Select an option to see the answer and solution.
Q257
Open questionSelect an option to see the answer and solution.
Q258
Open questionSelect an option to see the answer and solution.
Q259
Open questionSelect an option to see the answer and solution.
Q260
Open question#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
int main()
{
struct rlimit limit;
getrlimit(RLIMIT_FSIZE,&limit);
printf("%lu\n",limit.rlim_cur);
printf("%lu\n",limit.rlim_max);
return 0;
}Select an option to see the answer and solution.