summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorKarel Zak2018-10-24 12:28:13 +0200
committerKarel Zak2018-12-03 11:23:33 +0100
commit6df5acf970852a94b254800dc69569bd1f4c9ae8 (patch)
tree18751217f934f0dd328edd69fe4da5b6bfb0428c /configure.ac
parentbuild-sys: make sure HAVE_TIMER_CREATE defined (diff)
downloadkernel-qcow2-util-linux-6df5acf970852a94b254800dc69569bd1f4c9ae8.tar.gz
kernel-qcow2-util-linux-6df5acf970852a94b254800dc69569bd1f4c9ae8.tar.xz
kernel-qcow2-util-linux-6df5acf970852a94b254800dc69569bd1f4c9ae8.zip
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 <kzak@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac4
1 files changed, 4 insertions, 0 deletions
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"