pandora-build v0.74
[awesomized/libmemcached] / m4 / pandora_fdatasync.m4
diff --git a/m4/pandora_fdatasync.m4 b/m4/pandora_fdatasync.m4
new file mode 100644 (file)
index 0000000..3b9461e
--- /dev/null
@@ -0,0 +1,25 @@
+dnl  Copyright (C) 2009 Sun Microsystems
+dnl This file is free software; Sun Microsystems
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+#--------------------------------------------------------------------
+# Check for a working fdatasync call
+#--------------------------------------------------------------------
+
+
+AC_DEFUN([PANDORA_WORKING_FDATASYNC],[
+  AC_CACHE_CHECK([working fdatasync],[ac_cv_func_fdatasync],[
+    AC_LANG_PUSH(C++)
+    AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <unistd.h>
+      ]],[[
+fdatasync(4);
+      ]])],
+    [ac_cv_func_fdatasync=yes],
+    [ac_cv_func_fdatasync=no])
+    AC_LANG_POP()
+  ])
+  AS_IF([test "x${ac_cv_func_fdatasync}" = "xyes"],
+    [AC_DEFINE([HAVE_FDATASYNC],[1],[If the system has a working fdatasync])])
+])
\ No newline at end of file