]> granicus.if.org Git - check/commit
Use setitimer in timer_* fallbacks
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 21 Sep 2013 16:33:08 +0000 (16:33 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Sat, 21 Sep 2013 16:33:08 +0000 (16:33 +0000)
commitf54e5f305973309f6fb7d092cd3681ec371b4f4a
tree9b77e0e53cdc4057c81d8010d79f09ec31774869
parent464235693b9152a1d1dd726d59cc5ffa92a43bd6
Use setitimer in timer_* fallbacks

CCurrently on GNU/Hurd the timer_* functions are not implemented;
check's configure detects that and switches to the replacements
functions in lib/, which use alarm for the timer. However, using
alarm does not allow a timeout precision more than 1 second (as also
written in the comments in lib/timer_settime.c), causing the failure
of the two tests check_check_export and check_check.

As a workaround, it is possible to get a better precision using the
POSIX function setitimer [1] (declared obsolescent, but still usable)
instead of alarm.

This change checks for the existence of setitimer, and in case it
exists uses it (with its ITIMER_REAL timer) in the replacement
timer_settime and timer_delete. Given they are implemented in the
Hurd, all the tests of check passes.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/getitimer.html

Patch submitted by Pino Toscano, patch#49

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@759 64e312b2-a51f-0410-8e61-82d0ca0eb02a
AUTHORS
NEWS
configure.ac
lib/timer_delete.c
lib/timer_settime.c