Fall 2000 |
Lab 8: Signal |
CS61C (Patterson) |
Purpose:
Overview:
Prelab:
void (*signal (int sig, void (*disp)(int)))(int);
Translate that prototype into English. For example, in English the function prototype
void vacuum(int air);
is "vacuum is a function that takes an integer, air, and returns void."
Task1:
Write a simple C program, which, every 10 seconds, prints out the message "Contemplating meaning of life...\n". You may wish to read the man pages for "sleep", by typing man sleep on the command prompt.
After the program starts running, send an interrupt signal (Control-C) to stop execution.
HINT: Do you remember how to create an infinite loop?
Task2:
Task 3:
Additional Requirements:
Last updated: 10/07/2000