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
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.
- what does the program print, and in what order?
- 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
Get step-by-step solutions from verified subject matter experts
