Systems Programming Homework 3

Systems Programming Homework 3


  1. Programs can use signal to tell the kernel to ignore certain signals such as SIGINT and SIGQUIT. A different strategy is to prevent those signals from being generated in the first place. The terminal driver has a flag called ISIG. Read the manual pages to learn what the flag does. Then rewrite the program sigdemo2.c so it uses this flag.Make sure you are not ignoring SIGINT. Name it sigdemo4.c. Before you run this program read the instructions below and learn how to stop a program using kill.

    This program cannot be stopped from the keyboard. The usual control characters that generate signals are passed along as regular characters. The only way to stop this process is to open another xterm or login from another machine and kill the process running the program.

    Before you run this program learn how to use the kill command to kill a program by sending SIGINT to it from another terminal. Read about the optional arguments to kill to learn how to stop a program that is ignoring SIGINT.

  2. Write a program reaction.c that measures how quickly a user can respond. The program waits for a random interval of time and then prints a single digit on the screen. The user has to respond by typing that digit as quickly as possible. The program records how long it takes the user to respond. Your program should perform 10 such tests and report the minimum, maximum, and average response time. (Hint: Read the manual page for gettimeofday.)

Place both programs and a Makefile and any other information on running them in a directory hw3 for which the permissions only permit the user (you) to access it.

This assignment is an individual assignment, to be done on your own without help from other students in the class.

Instructions for submitting the homework using svn are contained in this file.

Due : Tuesday March 8, 2016


Paul A. Farrell