From 6df5acf970852a94b254800dc69569bd1f4c9ae8 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 24 Oct 2018 12:28:13 +0200 Subject: lib/timer: add fallback if timer_create() not available * add struct ul_timer as API abstraction to hide differences between timer_create() and setitimer() * add setitimer() detection to ./configure.ac * add fallback code to use setitimer() if timer_create() not available (for example on OSX) Addresses: https://github.com/karelzak/util-linux/issues/584 Signed-off-by: Karel Zak --- configure.ac | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 21b04f581..e6cfd4605 100644 --- a/configure.ac +++ b/configure.ac @@ -558,6 +558,10 @@ AC_CHECK_FUNCS([timer_create], AC_SUBST([REALTIME_LIBS]) +AS_IF([test x"$have_timer" = xno], [ + AC_CHECK_FUNCS([setitimer], [have_timer="yes"], [have_timer="no"]) +]) + AC_CHECK_LIB([rtas], [rtas_get_sysparm], [ RTAS_LIBS="-lrtas" -- cgit v1.2.3-55-g7522