]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libratbox/acinclude.m4
Clarify connection setup.
[irc/rqf/shadowircd.git] / libratbox / acinclude.m4
index 7e963d5a4ee23ce9719f72e92e1f1e4696fd0fc2..4a0c6e1364fe5c1d35a92ef282a4059c2f494120 100644 (file)
@@ -111,3 +111,42 @@ case $rb__cv_timer_create_works in
 esac
 ])
 
+
+
+AC_DEFUN([RB_CHECK_TIMERFD_CREATE],
+  [AC_CACHE_CHECK([for a working timerfd_create(CLOCK_REALTIME)], 
+    [rb__cv_timerfd_create_works],
+    [AC_TRY_RUN([
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_SYS_TIMERFD_H
+#include <sys/timerfd.h>
+#endif
+int main(int argc, char *argv[])
+{
+#if defined(HAVE_TIMERFD_CREATE) && defined(HAVE_SYS_TIMERFD_H)
+    if (timerfd_create(CLOCK_REALTIME, 0) < 0) {
+       return 1;
+    }
+#else
+    return 1;
+#endif
+    return 0;
+}
+     ],
+     [rb__cv_timerfd_create_works=yes],
+     [rb__cv_timerfd_create_works=no])
+  ])
+case $rb__cv_timerfd_create_works in
+    yes) AC_DEFINE([USE_TIMERFD_CREATE], 1, 
+                   [Define to 1 if we can use timerfd_create(CLOCK_REALTIME,...)]);;
+esac
+])
+