CVSROOT:        /cvs
Module name:    src
Changes by:     chel...@cvs.openbsd.org 2020/06/06 11:03:16

Modified files:
        games/grdc     : grdc.c 

Log message:
grdc(6): implement timeout with alarm(3)

grdc(6) has an optional argument indicating a timeout in seconds.
For example, one could do:

$ grdc 60

to to tell grdc(6) to run for sixty seconds and then exit gracefully.

As implemented, however, the timeout may occur too early or too late
if the system clock is reset with settimeofday(2).

To avoid this problem we can instead use alarm(3) and a signal handler
to implement the timeout.  alarm(3) is unaffected by settimeofday(2).

Reply via email to