From ad01edb37bdf7e1087eb18ed903b37dbc0241af1 Mon Sep 17 00:00:00 2001 From: James Peach Date: Tue, 31 Jan 2006 21:56:12 +0000 Subject: r13263: Check whether open(2) will accept the O_DIRECT flag. This should fix the build on NetBSD. (This used to be commit 7354de62a7fbf3921dfcb0bd865e89bdf1ef5bcd) --- source4/build/m4/rewrite.m4 | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'source4/build/m4/rewrite.m4') diff --git a/source4/build/m4/rewrite.m4 b/source4/build/m4/rewrite.m4 index f0279c69d0..cd39371354 100644 --- a/source4/build/m4/rewrite.m4 +++ b/source4/build/m4/rewrite.m4 @@ -496,6 +496,18 @@ fi ;; esac +AC_CACHE_CHECK([for O_DIRECT flag to open(2)],samba_cv_HAVE_OPEN_O_DIRECT,[ +AC_TRY_COMPILE([ +#include +#ifdef HAVE_FCNTL_H +#include +#endif], +[int fd = open("/dev/null", O_DIRECT);], +samba_cv_HAVE_OPEN_O_DIRECT=yes,samba_cv_HAVE_OPEN_O_DIRECT=no)]) +if test x"$samba_cv_HAVE_OPEN_O_DIRECT" = x"yes"; then + AC_DEFINE(HAVE_OPEN_O_DIRECT,1,[Whether the open(2) accepts O_DIRECT]) +fi + ############################################### # test for where we get crypt() from AC_CHECK_LIB_EXT(crypt, CRYPT_LIBS, crypt) -- cgit