Q581
Open questionSelect 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
30/50
Page
Pick an option on a question to see the right answer and solution.
Q581
Open questionSelect an option to see the answer and solution.
Q582
Open questionSelect an option to see the answer and solution.
Q583
Open questionexec < file1
exec < file2
exec < file3
read lineSelect an option to see the answer and solution.
Q584
Open questionSelect an option to see the answer and solution.
Q585
Open questionSelect an option to see the answer and solution.
Q586
Open questionSelect an option to see the answer and solution.
Q587
Open question#include<stdio.h>
#include<sys/time.h>
#include<sys/resource.h>
int main()
{
struct rlimit limit;
limit.rlim_cur = 10;
if(setrlimit(RLIMIT_NOFILE,&limit) != 0)
perror("setrlimit");
return 0;
}Select an option to see the answer and solution.
Q588
Open questionSelect an option to see the answer and solution.
Q589
Open question#define PERMS (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)
int main()
{
int fd1, fd2;
umask(0);
fd1 = open(“file1”, O_CREAT | O_RDWR, PERMS)
umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
fd2 = open(“file2”, O_CREAT | O_RDWR, PERMS)
return 0;
}
The newly created files file1 and file2 will have the permissions respectivelySelect an option to see the answer and solution.
Q590
Open question#include<stdio.h>
#include<pthread.h>
int a;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
printf("%d\n",a);
pthread_exit("Bye");
}
int main()
{
pthread_t pt;
void *res_t;
a = 10;
if(pthread_create(&pt,NULL,fun_t,NULL) != 0)
perror("pthread_create");
if(pthread_join(pt,&res_t) != 0)
perror("pthread_join");
return 0;
}Select an option to see the answer and solution.
Q591
Open questionSelect an option to see the answer and solution.
Q592
Open questionSelect an option to see the answer and solution.
Q593
Open questionSelect an option to see the answer and solution.
Q594
Open questionSelect an option to see the answer and solution.
Q595
Open questionSelect an option to see the answer and solution.
Q596
Open questionSelect an option to see the answer and solution.
Q597
Open questionSelect an option to see the answer and solution.
Q598
Open question#include<stdio.h>
#include<stdlib.h>
#include<netinet/in.h>
#include<sys/types.h>
#include<sys/socket.h>
int main()
{
int fd_server, fd_client, len, len_client;
struct sockaddr_in add_server, add_client;
char buff[10];
fd_server = socket(AF_INET,SOCK_STREAM,0);
if (fd_server == -1)
{
perror("fd_sock");
exit(1);
}
len = sizeof(add_server);
len_client = sizeof(add_client);
if( bind(fd_server,(struct sockaddr*)&add_server,len) != 0)
perror("bind");
fd_client = accept(fd_server,(struct sockaddr*)&add_client,len_client);
if(fd_client == -1)
perror("accept");
read(fd_client,buff,10);
return 0;
}Select an option to see the answer and solution.
Q599
Open questionSelect an option to see the answer and solution.
Q600
Open questionSelect an option to see the answer and solution.