Question: Use Ubuntu system and run the .c file. Answer the questions below. Sample Program 1 #include #include #include #include void sigHandler (int); int main() {

Use Ubuntu system and run the .c file. Answer the questions below.

Sample Program 1

#include #include #include #include

void sigHandler (int);

int main() { signal (SIGINT, sigHandler); printf ("waiting... "); pause(); return 0; }

void sigHandler (int sigNum) { printf (" received an interrupt. "); // this is where shutdown code would be inserted sleep (1); printf ("outta here. "); exit(0); }

Perform the following operations and answer the questions:

  • study, compile and run Sample Program 1. Send the program an interrupt via the keyboard.
  1. what does the program print, and in what order?
  2. describe exactly what is happening to produce the answer observed for the above question

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!