in Operating System recategorized by
11,061 views
43 votes
43 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
in Operating System recategorized by
11.1k views

10 Comments

Some one can explain this?? How's this work?
2
2
Why is it A and not B ?
0
0
@arjun sir plz explain this
0
0
@Bikram sir

in this why option b wrong ?

ctrl+c is hardware interrupt so it can be handle in kernel mode
0
0

@set2018 

A user level process in Unix traps the signal sent on a Ctrl-C input

That means when an user sent an input  an user level process handle that signal

That's why it is in user mode and not in kernel mode .  

ctrl+c is hardware interrupt so it can be handle in kernel mode

Yes ctrl+c is hardware interrupt .. but it clearly mention in question that " an user level process in Unix traps the signal" , an user level process working in user mode so signal handling routine executes in user mode only.

You may see my detail answer below.

12
12

@Bikram Sir,

This trap might refer to the trap sent as the software interrupt to the os.

And it is mentioned that whatever trap occured(Whether in system or user process), results in switch to kernel mode.

Then, why answer A is valid in such Case?

Shouldn't the answer be (B) ?

0
0
edited by

Notice line --> Signals by default are handled by the kernel.

The default action for handling each signal is defined in the kernel too, and usually it terminates the process that received the signal.

So answer could be option (A) or (B). Please correct me if i am wrong. 

https://stackoverflow.com/questions/6108953/how-does-ctrl-c-terminate-a-child-process

https://stackoverflow.com/questions/14960579/process-file-descriptors-and-sigkill-signal-behavior

https://stackoverflow.com/questions/2541597/how-to-gracefully-handle-the-sigkill-signal-in-java

0
0
signals may be handled by two possible handlers,default or if user defined overriding default one.Here which is handling the signal?default or user defined?
0
0
I think this question could be done by option elimination method:

Since b and d are the same hence they both cannot be the answer as multiple options not allowed.

Now, superuser mode is a mode that requires an administrator to do certain tasks.

Now think of a situation when you are using a computer in guest mode. Now you have written an infinite loop program and running in cmd. Now to stop cmd you will press ctrl+c and immediately the program stops without asking any permission. Now, this means CPU does not ask you for admin permission to do ctrl+c. This means the task can be done without going superuser mode.

Now, you have only one option left. Hence, A will be the answer.

Please correct if I'm wrong.
1
1
edited by
is this in syllabus?
2
2

7 Answers

43 votes
43 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

4 Comments

superuser mode ---

Sudo command

Sudo (superuser do) is a utility for UNIX- and Linux-based systems that provides an efficient way to give specific users permission to use specific system commands at the root (most powerful) level of the system

0
0

@BikramIn Linux we write sudo...something. Which means user mode, right?

0
0
22 votes
22 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

 

1 comment

This shd be the best ans.
0
0
9 votes
9 votes

1 comment

according to this link it should be kernel mode right?
0
0
3 votes
3 votes
Answer: A

3 Comments

what is the difference between kernel mode and privledge mode... ?? why only A is answer not C?
1
1
Privilege mode and kernel mode both are the same thing so the  answer can be A or C
1
1

@S Ram

Kernel mode == Privileged mode

so option B == option D , when an user send a request it can not be in privileged mode so both option B and D are wrong ..

there is nothing called super user mode so option C is wrong clearly ..

we only left with option A , and that is correct option .

4
4
Answer:

Related questions