r22097: Add detection for linux readahead() syscall.
authorJeremy Allison <jra@samba.org>
Fri, 6 Apr 2007 01:09:19 +0000 (01:09 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:12 +0000 (12:19 -0500)
Jeremy.
(This used to be commit 4e3232aad4179e4ca9a1138bc43addec2ea6d9cc)

source3/configure.in

index 803425a66aa413bc59e27e00d12c80487ccc916a..7eb1b78a01bde185af8a4f3e0d4d1629818bd786 100644 (file)
@@ -5649,6 +5649,25 @@ samba_cv_HAVE_SENDFILE=yes,samba_cv_HAVE_SENDFILE=no)])
   AC_MSG_RESULT(yes)
 )
 
+############################################
+# See if we have the Linux readahead syscall.
+
+AC_CACHE_CHECK([for Linux readahead],
+                samba_cv_HAVE_LINUX_READAHEAD,[
+    AC_TRY_LINK([
+#if defined(HAVE_UNISTD_H)
+#include <unistd.h>
+#endif
+#include <fcntl.h>],
+    [ssize_t err = readahead(0,0,0x80000);],
+    samba_cv_HAVE_LINUX_READAHEAD=yes,
+    samba_cv_HAVE_LINUX_READAHEAD=no)])
+
+if test x"$samba_cv_HAVE_LINUX_READAHEAD" = x"yes"; then
+  AC_DEFINE(HAVE_LINUX_READAHEAD,1,
+             [Whether Linux readahead is available])
+fi
+
 
 #################################################
 # Check whether winbind is supported on this platform.  If so we need to