81. Which signal is generated when we press ctrl-Z?
82. Which of the following enables multi-tasking in UNIX?
83. From where would the read statement read if the following statements were executed?
exec < file1
exec < file2
exec < file3
read line
exec < file1
exec < file2
exec < file3
read line
84. Which file shows the parameter passed to kernel at the time of starting?
85. In GCC compiler, "-shared" option is given to create the shared library with
86. What is temporary breakpoint?
87. What is the output of this program?
#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;
}
#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;
}
88. What is the command that can print lines of first file matching with second file?
89. Given a code snippet below?
#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 respectively
#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 respectively90. What is the output of this program?
#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;
}
#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;
}
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.