Linux Interview Questions and Answers on Signal Handling for Freshers

1. If a signal is received by a process, when will it be processed?

a) It is processed immediately
b) It is processed when process is switching to kernel mode
c) It is processsed in the next timeslice given to the process
d) None of the mentioned
Answer: b
2. Which signal is generated when we press control-C?

a) SIGINT
b) SIGTERM
c) SIGKILL
d) SIGSEGV
Answer: a
3. Which signal is generated when we press ctrl-Z?

a) SIGKILL
b) SIGSTOP
c) SIGABRT
d) SIGINT
Answer: b
4. Which signal is sent when the Child process terminates?

a) SIGINIT
b) SIGKILL
c) SIGSTOP
d) SIGCHLD
Answer: d
5. Which of the following signal cannot be handled or ignored?

a) SIGINT
b) SIGCHLD
c) SIGKILL
d) SIGALRM
Answer: c
6. Another signal that cannot be caught is:

a) SIGPIPE
b) SIGHUP
c) SIGSTOP
d) SIGUSR1
Answer: c
7. When real interval timer expires which signal is generated?

a) SIGINT
b) SIGCHLD
c) SIGKILL
d) SIGALRM
Answer: d
8. Signals are handled using which system call?

a) kill
b) signal
c) both
d) none
Answer: b
9. Default action of SIGSEGV is

a) Terminate
b) Core dump + Terminate
c) Stop
d) Cont
Answer: b
10. The kill system call is used to

a) Send shutdown messages to all by superuser
b) Send a signal to a process
c) Kill processes
d) Stop the processes
Answer: b
11. What is the output of the below code?
    void sig_handler ( int signum) {
        printf(“Handled the signal\n”);
    }
 
    int main() {
        int pid;
        signal (SIGKILL, sig_handler);
        pid = fork();
        if (pid==0) {
            kill(getppid(), SIGKILL);
            exit(0);
        } else {
            sleep(20);
        }
        return 0;
    }
a) Error child cannot send a SIGKILL signal to parent
b) Parent goes to the signal handler, prints handled the signal and goes back to sleep
c) Parent goes to the signal handler, prints handled the signal and exits
d) Parent exits without going to the signal handler
Answer: d

Related

Computer Fundamentals Multiple choice Questions and Answers on Internet of Things for Freshers

1. A network of physical objects or things embedded with electronics or softwares. a) AIb) MLc) IOTd) Internet Answer: c Explanation: IoT is a network of physical objects or things embedded with ...

Computer Fundamentals Multiple choice Questions and Answers on Types of Computers for Freshers

1. Which of the following is not a type of computer on the basis of operation? a) Remoteb) Hybridc) Analogd) Digital Answer: a Explanation: There are three types of computers basically on the bas...

Computer Fundamentals Multiple choice Questions and Answers on Cloud Computing for Freshers

1. ________________ is a paradigm of distributed computing to provide the customers on-demand, utility based computing service. a) Remote Sensingb) Remote Invocationc) Cloud Computingd) Private Com...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item