Basic Computer Knowledge Test Questions and Answers

Linux Debugging Questions & Answers – Signal Handling System Calls

1.

What will happen as we press the “Ctrl+c” key after running this program?

  1.    #include<stdio.h>
  2.    #include<signal.h>
  3. 
     
  4.    void response (int);
  5.    void response (int sig_no)
  6.    {
  7.        printf("Linux\n");
  8.    }
  9.    int main()
  10.    {
  11.        signal(SIGINT,response);
  12.        while(1){          
  13.            printf("Sanfoundry\n");
  14.            sleep(1);
  15.        }
  16.        return 0;
  17.    }

   A.) the string “Linux” will print
   B.) the process will be terminated after printing the string “Linux”
   C.) the process will terminate
   D.) none of these

Answer: Option 'A'

the string “Linux” will print

Linux Debugging Questions & Answers – Signal Handling System Calls Download Pdf

Recent Posts