From 378543e13f93c522b976efddd1610a19a6601b1c Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Mon, 9 Feb 2015 23:18:09 +0000 Subject: flock: improve timeout handling Signal ALRM raised by the timer, and the timer only, will be considered as a timeout criteria. Secondly time interval is made to use monotonic clock. Documentation of ITIMER_REAL is unclear whether that time is affected various sources of clock skew, or does it even tick when system is suspended. Reviewed-by: Karel Zak Signed-off-by: Sami Kerola --- configure.ac | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 5d2b68503..9dec9d897 100644 --- a/configure.ac +++ b/configure.ac @@ -371,10 +371,16 @@ AC_CHECK_FUNCS([ioperm iopl], [have_io=yes]) AC_CHECK_FUNCS([futimens], [have_futimens=yes]) AC_CHECK_FUNCS([inotify_init1], [have_inotify_init1=yes]) -dnl Old glibc requires -lrt -AC_CHECK_FUNCS(clock_gettime, [], [ - AC_CHECK_LIB(rt, clock_gettime, [ - AC_DEFINE(HAVE_CLOCK_GETTIME, 1) +dnl lib/mononotic.c may require -lrt +AC_CHECK_FUNCS([clock_gettime], + [AC_CHECK_FUNCS([timer_create], [], [ + AC_CHECK_LIB([rt], [timer_create], [ + AC_DEFINE([HAVE_CLOCK_GETTIME], [1]) + CLOCKGETTIME_LIBS="-lrt" + ]) + ])], + [AC_CHECK_LIB([rt], [clock_gettime], [ + AC_DEFINE([HAVE_CLOCK_GETTIME], [1]) CLOCKGETTIME_LIBS="-lrt" ]) ]) -- cgit v1.2.3-55-g7522