recategorized by
18,362 views
57 57 votes
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes?
  1. User mode
  2. Kernel mode
  3. Superuser mode
  4. Privileged mode

8 Answers

60 60 votes
  • When an user send an input to the process it can not be in privileged mode  as it is coming from an user so option D , Privileged mode can not be possible here ..

Now see , kernel mode = Privileged mode 

  • That means both option B and option D are equal. As option D can not be possible , option B also false.
  • There is nothing called  superuser mode so option C is clearly wrong .
  • Only option A is left , when an user input come like ' ctrl+c' the signal handling routine executes in user mode only as a user level process in UNIX traps the signal.

Hence option A is correct answer.

edited by
59 59 votes

 

This is what the Galvin text has to say.  Usually, there are two types of signal handlers: Kernel Level and user level. Now the kernel level is the default one. But if we look at the wordings of the question in details :

A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process.

It clearly means that the signal handling routine is a part of the user-level process and hence it shall run in user mode.

 

Ans: (A) USER MODE

 

3 3 votes
Answer: A
2 2 votes

Answer = Kernel mode.
Explanation.
Hardware interrupts (also called external/asynchronous interrupts), are ones in which the notification originates from a hardware device such as a keyboard, mouse , etc.
The most common way of sending signals to processes is using the keyboard:
• Ctrl-C: Causes the system to send an INT signal (SIGINT) to the running process.
• Ctrl-Z: causes the system to send a TSTP signal (SIGTSTP) to the running process.
The kernel handles signals in the context of the process that receives them, so
a process must run to handle signals.

1 1 vote
The question says "signal handling routine that saves appropriate files BEFORE TERMINATING THE PROCESS" . This means we are still in user mode. So answer is A.
Answer:
Position:
Show:

Related questions

13 13 votes
3 answers 3 answers
15.3k
15.3k views
Kathleen asked Sep 22, 2014
15,295 views
A common property of logic programming languages and functional languages is:both are procedural languages both are based on $\lambda$-calculusboth are declarativeboth us...
7 7 votes
4 answers 4 answers
8.1k
8.1k views
Ishrat Jahan asked Oct 30, 2014
8,115 views
Consider the following pseudo-code:IF ((A B) AND (C D)) THEN A = A + 1 B = B + 1 ENDIFThe cyclomatic complexity of the pseudo-code is2345
45 45 votes
6 answers 6 answers
18.5k
18.5k views
Ishrat Jahan asked Oct 29, 2014
18,466 views
Consider a weighted, undirected graph with positive edge weights and let $uv$ be an edge in the graph. It is known that the shortest path from the source vertex $s$ to $u...
88 88 votes
7 answers 7 answers
38.1k
38.1k views
Rucha Shelke asked Sep 26, 2014
38,118 views
A computer system supports $32$-bit virtual addresses as well as $32$-bit physical addresses. Since the virtual address space is of the same size as the physical address ...