This set of Tricky Unix Questions and Answers focuses on “Process Control System Calls – 2”.
1. ___ system call behaves in an identical manner to the kill command.
a) alarm
b) kill
c) pause
d) signal
View Answer
Explanation: kill system call behaves in an identical manner to the kill command. kill sends a signal but doesn’t necessarily kill a process.
2. Which library function uses kill to send any signal to the current process?
a) getc
b) raise
c) catch
d) try
View Answer
Explanation: kill sends a signal but doesn’t necessarily kill a process. Kill system call is used by the library function raise to send any signal to the current process.
3. Which system call is used to set a timer that generates the SIGALARM signal?
a) pause
b) alarm
c) read
d) signal
View Answer
Explanation: The alarm call is used to set a timer that generates the SIGALRM signal after the timeout period.
4. If two users execute the same program, the memory requirements are doubled.
a) True
b) False
View Answer
Explanation: If two users execute the same program then memory requirements are not doubled, the text segment in the virtual address space is shared.
5. Address space of a process is virtual.
a) True
b) False
View Answer
Explanation: We say that the address space of a process is virtual because the address specified in the executable doesn’t point to the actual memory location. The virtual addresses are translated into a physical address at runtime by memory management unit (MMU).
6. Which of the following system calls returns one or more file descriptors?
a) dup, dup2
b) fcntl
c) pipe
d) dup, dup2, fcntl and pipe
View Answer
Explanation: dup, dup2, fcntl and pipe are the system calls which returns one or more file descriptors when invoked.
7. The environment variables are available in _____
a) *environ[ ]
b) env[ ]
c) env
d) pipe
View Answer
Explanation: The environment variables transmitted from parent process to child are available in environ[ ] variable.
8. Which of the following functions are used for obtaining and setting the value of environment variables?
a) getenv
b) setenv
c) env
d) getenv and setenv
View Answer
Explanation: The environment variables transmitted from parent process to child are available in environ[ ] variable. POSIX specifies two functions, getenv and setenv to obtain and set these values.
9. Which of the following action can be taken by a process upon receiving a signal?
a) ignore the signal
b) terminate the process
c) suspend the process
d) ignore the signal, terminate and suspend the process
View Answer
Explanation: How a process responds to a signal depends on how things are set up in the program representing the process. However, there are mainly three actions that a program can take upon receiving a signal i.e. ignore the signal and continue execution normally, terminate the process, suspend (stop) the program.
10. What is the default disposition of most signals?
a) ignore the signal
b) terminate the process
c) suspend the process
d) kill the signal
View Answer
Explanation: The action that a signal takes on receipt of a signal is called disposition. The default disposition of most signals is to terminate the process.
Sanfoundry Global Education & Learning Series – Unix.
To practice tricky questions and answers on all areas of Unix, here is complete set of 1000+ Multiple Choice Questions and Answers.
- Get Free Certificate of Merit in Unix
- Participate in Unix Certification Contest
- Become a Top Ranker in Unix
- Take Unix Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Apply for Computer Science Internship
- Apply for Unix Internship
- Practice MCA MCQs
- Practice Computer Science MCQs
- Buy MCA Books