FAQ/Announcements for Lab3 from Nutt

Announcements:

FAQ

Q:  What does he mean in Part A when he says "implement your version of gettimeofday()?"  That isn't really described anywhere else in the chapter.

A:  You are correct.  What he really wants you to do is develop a short program which uses ITIMER_REAL and the "signal" capabilities of C to create a timer.  I would suggest you modify the code on page 87 and 88 to do this.  However, instead of using the values used on those pages, you will want to set up ITIMER_REAL to signal once per second.  Put some dummy process between the setitimer and getitimer calls (read a single character from stdin) so that you have some control over how long between the time you start the timer and read the timer.  Since you will likely not provide input before the timer goes off, you will also need to create your own signal handler (see page 92 although your handler will not actually take a parameter) which counts that it was signaled and resets itself.