Question 1 |
Which of the following standard C library functions will always invoke a system call when executed from a single-threaded process in a UNIX/Linux operating system?
[MSQ]
[MSQ]
exit | |
malloc | |
sleep | |
strlen |
Question 1 Explanation:
Question 2 |
The following C program is executed on a Unix / Linux system:
#include < unistd.h >
int main() {
int i;
for (i = 0; i < 10; i++)
if (i % 2 == 0) fork();
return 0;
}
The total number of child process created is __________ .31 | |
63 | |
5 | |
6 |
Question 2 Explanation:
Question 3 |
The difference between a named pipe and a regular file in Unix is that
Unlike a regular file, named pipe is a special file | |
The data in a pipe is transient, unlike the content of a regular file | |
Pipes forbid random accessing, while regular files do allow this. | |
All of the above |
Question 3 Explanation:
Question 4 |
The following C program:
{
fork(); fork(); printf("yes");
}
If we execute this core segment, how many times the string yes will be printed?Only once | |
2 times | |
4 times | |
8 times |
Question 4 Explanation:
Question 5 |
The Linux command
mknod myfifo b 4 16
will create a character device if user is root | |
will create a named pipe FIFO if user is root | |
will create a block device if user is root | |
None of these |
Question 5 Explanation:
Question 6 |
Wha is the output of the following program?
main()
{
int a = 10;
if(fork()) == 0))
a++;
printf("%d\n",a);
}
10 and 11 | |
10 | |
11 | |
11 and 11 |
Question 6 Explanation:
Question 7 |
Consider the following program.
main()
{
fork();
fork();
fork();
}
How many new processes will be created?8 | |
6 | |
7 | |
5 |
Question 7 Explanation:
Question 8 |
Identify the correct order in which a server process must invoke the function calls accept, bind, listen, and recv according to UNIx socket API.
listen, accept, bind, recv | |
bind, listen, accept, recv | |
bind, accept, listen, recv | |
accept, listen, bind, recv |
Question 8 Explanation:
Question 9 |
A process executes the code
fork();
fork();
fork();
The total number of child processes created is
fork();
fork();
fork();
The total number of child processes created is
3 | |
4 | |
7 | |
8 |
Question 9 Explanation:
Question 10 |
Which of the following UNIX command allows scheduling a program to be executed at the specifies time?
cron | |
nice | |
date and time | |
schedule |
Question 10 Explanation:
There are 10 questions to complete.
question number 21 correct option should be c.
Thank You Ankur Maurya,
We have updated the option.
Q. No 21 should be option C