JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD
JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2018 LINUX PROGRAMMING Previous Question Paper (January - 2018 - R15)
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.
PART - A
Describe the special parameters used by shell.
Answer
Special parameters in the shell are internal variables that provide information about the script or command execution. Key special parameters include:
- $0: Expands to the name of the shell or shell script.
- $n: Expands to the nth positional parameter (where n is a digit).
- $#: Expands to the number of positional parameters.
- $*: Expands to all positional parameters starting from one.
- $@: Expands to all positional parameters, treating each as a separate word.
- $?: Expands to the exit status of the most recently executed foreground pipeline.
- $$: Expands to the process ID of the shell.
- $!: Expands to the process ID of the most recently executed background command.
What are hard links? Give their advantages and disadvantages.
Answer
A hard link is a directory entry that associates a filename with an existing inode on the file system. It essentially creates an additional name for the same data on the disk.
Advantages: Hard links are efficient as they do not consume extra disk space for data, and the file remains accessible as long as at least one hard link exists, even if the original filename is deleted.
Disadvantages: They cannot span across different file systems or partitions, and they cannot be created for directories to prevent circular references in the file system structure.
Discuss the role of kill and raise functions in signal generation.
Answer
Sign in to view the complete answer paper.
Write a program to implement the creation of a pipe.
Answer
Sign in to view the complete answer paper.
What system calls are used to send and receive the data through sockets?
Answer
Sign in to view the complete answer paper.
PART - B
What is sed? Explain addressing in sed with suitable examples.
Answer
Sign in to view the complete answer paper.
What is the exit status of a command and where is it stored?
Answer
Sign in to view the complete answer paper.
Write a shell script to display the current users of the system who have logged in for more than half an hour.
Answer
Sign in to view the complete answer paper.
What is an i-node? Explain the process of conversion of file path name to an i-node.
Answer
Sign in to view the complete answer paper.
Explain fseek, fopen, fclose system call in detail.
Answer
Sign in to view the complete answer paper.
What is a directory? List and explain various directory maintenance systems calls that are present in unix.
Answer
Sign in to view the complete answer paper.
What is a zombie process? Give its significance.
Answer
Sign in to view the complete answer paper.
Write a program to implement the sleep function.
Answer
Sign in to view the complete answer paper.
Explain the role of the following system calls with respect to process: a) fork() b) Wait() c) Exec() d) waitpid e) vfork
Answer
Sign in to view the complete answer paper.
How to achieve the inter process communication by using FIFOs? Explain with some code snippets.
Answer
Sign in to view the complete answer paper.
What is Semaphore? Explain how you would use semaphore system calls to solve critical section problems.
Answer
Sign in to view the complete answer paper.
Describe the role of port numbers with respect to sockets.
Answer
Sign in to view the complete answer paper.
Explain Byte-Ordering, address format and address lookup in Sockets.
Answer
Sign in to view the complete answer paper.
What is a socket? Explain the socket system call along with the parameters present in it.
Answer
Sign in to view the complete answer paper.
Which system call is used to create shared memory segment and explain it.
Answer
Sign in to view the complete answer paper.