Try running the program in Listing 23-3 (t_nanosleep.c) in the background with a 60-second sleep interval, while
Fantastic news! We've Found the answer you've been seeking!
Question:
Try running the program in Listing 23-3 (t_nanosleep.c) in the background with a 60-second sleep interval, while using the following command to send as many SIGINT signals as possible to the background process:
You should observe that the program sleeps rather longer than expected. Replace the use of nanosleep() with the use of clock_gettime() (use a CLOCK_REALTIME clock) and clock_nanosleep() with the TIMER_ABSTIME flag. (This exercise requires Linux 2.6.) Repeat the test with the modified program and explain the difference.
Related Book For
Posted Date: