summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace/README5
-rw-r--r--source3/lib/replace/libreplace.m41
-rw-r--r--source3/lib/replace/replace.h5
3 files changed, 11 insertions, 0 deletions
diff --git a/source3/lib/replace/README b/source3/lib/replace/README
index 77558b2ca9..a2f9e2fa29 100644
--- a/source3/lib/replace/README
+++ b/source3/lib/replace/README
@@ -55,6 +55,11 @@ strtoull
socketpair
strptime
+These external declarations are provided for those systems which lack the
+declaration but provide the function:
+
+readahead
+
Types:
bool
socklen_t
diff --git a/source3/lib/replace/libreplace.m4 b/source3/lib/replace/libreplace.m4
index e9b19b7cf5..a030ce2e90 100644
--- a/source3/lib/replace/libreplace.m4
+++ b/source3/lib/replace/libreplace.m4
@@ -155,6 +155,7 @@ AC_CHECK_FUNCS(pread pwrite strndup strcasestr strtok_r mkdtemp socketpair)
AC_HAVE_DECL(setresuid, [#include <unistd.h>])
AC_HAVE_DECL(setresgid, [#include <unistd.h>])
AC_HAVE_DECL(errno, [#include <errno.h>])
+AC_HAVE_DECL(readahead, [#include <fcntl.h>])
AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[
AC_TRY_RUN([#include <stdlib.h>
diff --git a/source3/lib/replace/replace.h b/source3/lib/replace/replace.h
index b96356ac46..916d5a55e6 100644
--- a/source3/lib/replace/replace.h
+++ b/source3/lib/replace/replace.h
@@ -111,6 +111,11 @@ extern char *sys_errlist[];
extern int errno;
#endif
+#if defined(HAVE_LINUX_READAHEAD) && ! defined(HAVE_READAHEAD_DECL)
+ssize_t readahead(int fd, off64_t offset, size_t count);
+#endif
+
+
#ifndef HAVE_STRDUP
#define strdup rep_strdup
char *rep_strdup(const char *s);