Chapter 4 Lecture slides (On signals).
Purpose: This assignment is to gain experience with signals. A) Signal Handling:
Begin with a copy the following starter programs: /net/326/signal.c
In this program, after 6 seconds, an alarm goes off and the program terminates.
Add a procedure and the associated signal handling, so that when the alarm goes off the message Ring Ring is printed to the screen and the program continues.
When you test your program also try the control-C to make sure the Got signal is still working. B) Sigaction:
Make a copy of your signal.c from Part A after you complete it.
Modify it to use sigaction instead of the traditional signal function.
It should functionally remain the same.
Demo: Your Part A signal program. You do not need to demo or submit part B, but questions related to it may be asked on exams.
Reviews
There are no reviews yet.