JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2019 LINUX PROGRAMMING Previous Question Paper (December - 2019 - R17)
Note: This question paper contains two parts A and B. Part A is compulsory which carries 25 marks. Answer all questions in Part A. Part B consists of 5 Units. Answer any one full question from each unit. Each question carries 10 marks and may have a, b, c as sub questions.
Part A
Explain about the interrupt processing in shell script.
Answer
Interrupt processing in shell scripts is handled using the trap command. It allows a script to catch signals sent by the kernel or user (like SIGINT from Ctrl+C or SIGTERM) and execute a specified command or function instead of terminating immediately. The syntax is
Write and explain the syntax of fflush and fseek with an example.
Answer
fflush(FILE *stream) clears the output buffer of a stream. It is used to ensure that data written to a file or standard output is physically flushed to the destination immediately. If the stream is NULL, it flushes all open output streams.
fseek(FILE *stream, long offset, int whence) sets the file position indicator for a stream. The whence argument determines the starting point: SEEK_SET (beginning), SEEK_CUR (current position), or SEEK_END (end of file). Example:
FILE *fp = fopen("test.txt", "w+");
fputs("Hello World", fp);
fflush(fp);
fseek(fp, 0, SEEK_SET);Explain about the Zombie process.
Answer
Sign in to view the complete answer paper.
What is Inter Process Communication? Explain the IPC methods supported by the Linux.
Answer
Sign in to view the complete answer paper.
Write a program to illustrate read process from shared memory (read data from shared memory and writing to the standard output).
Answer
Sign in to view the complete answer paper.
Part B
Write a shell script to find the factorial of a given number.
Answer
Sign in to view the complete answer paper.
Explain about the characteristics of shell.
Answer
Sign in to view the complete answer paper.
Explain about the control structures are used in shell programming.
Answer
Sign in to view the complete answer paper.
Write a shell script to sort a given list of numbers in ascending order.
Answer
Sign in to view the complete answer paper.
Explain the various file types in a UNIX system.
Answer
Sign in to view the complete answer paper.
Write a program to display the number of lines, words and characters in a file.
Answer
Sign in to view the complete answer paper.
Explain about the file descriptors.
Answer
Sign in to view the complete answer paper.
Explain the different types of operators are used in Perl.
Answer
Sign in to view the complete answer paper.
Write and explain the syntax of the following functions i) kill ii) raise
Answer
Sign in to view the complete answer paper.
Write the syntax of six versions of exec functions and also explain how these functions differ from each other.
Answer
Sign in to view the complete answer paper.
What is process? Explain how a process can be created and terminated in Linux operating system.
Answer
Sign in to view the complete answer paper.
What are pipes? Explain their limitations. Explain how pipes are created and used in IPC with an example programs.
Answer
Sign in to view the complete answer paper.
Write a program to transfer a large amount of data between two processes using message queues.
Answer
Sign in to view the complete answer paper.
Write a program to illustrate file locking using semaphores.
Answer
Sign in to view the complete answer paper.
Explain about the unix kernel support for semaphores.
Answer
Sign in to view the complete answer paper.
Explain the socket system calls for connectionless protocol.
Answer
Sign in to view the complete answer paper.
Explain in detail the Linux API for shared memory.
Answer
Sign in to view the complete answer paper.