+if test "x$enable_direct_io" = "xyes"; then
+AC_CACHE_CHECK([for O_DIRECT flag to open(2)],rrd_cv_HAVE_OPEN_O_DIRECT,[
+AC_TRY_COMPILE([
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif],
+[int fd = open("/dev/null", O_DIRECT);],
+rrd_cv_HAVE_OPEN_O_DIRECT=yes,rrd_cv_HAVE_OPEN_O_DIRECT=no)])
+ if test "x$rrd_cv_HAVE_OPEN_O_DIRECT" = "xyes"; then
+ AC_DEFINE(USE_DIRECT_IO,1,[Whether the open(2) accepts O_DIRECT])
+ else
+ enable_direct_io="no"
+ fi
+else
+ enable_direct_io="no"
+fi
+