From 1b55cf43849543babe0210ea0260752212a53f22 Mon Sep 17 00:00:00 2001 From: Derrell Lipman Date: Thu, 10 May 2007 01:27:18 +0000 Subject: r22772: - Still working on the fact that readahead() is not declared (on at least one OS) but is available for linking. Instead of running configure tests with -Werror-implicit-function-declaration in developer mode (which may lead to different library functions being used in developer mode than when not in developer mode), add tests for whether readahead is declared. If not, provide a replacement declaration in lib/replace. (This used to be commit 7d05fa8b32b5b33e95fd9d552d2a45013b4803ec) --- source3/configure.in | 13 ------------- source3/lib/replace/README | 5 +++++ source3/lib/replace/libreplace.m4 | 1 + source3/lib/replace/replace.h | 5 +++++ 4 files changed, 11 insertions(+), 13 deletions(-) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 497c4ac624..8c728deea2 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1337,19 +1337,6 @@ AC_CHECK_LIB(exc, trace_back_stack) # implicit declaration warnings without failing the test (in developer mode) ac_no_error_on_warning_CFLAGS="${CFLAGS}" -# Since --enable-developer causes warnings to be treated as errors during -# compilation, we should avoid using features that will fail to compile. -# -# We don't want to enable this earlier because the built-in functions such as -# memset fail to configure properly. - -if test x"$samba_cv_HAVE_Werror_implicit_function_declaration" = x"yes" -a \ - x"$developer" = xyes; then - CFLAGS="${CFLAGS} -Werror-implicit-function-declaration" - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -fi - echo -n "checking for GPFS GPL libs... " save_LIBS="$LIBS" LIBS="$LIBS -lgpfs_gpl" 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 ]) AC_HAVE_DECL(setresgid, [#include ]) AC_HAVE_DECL(errno, [#include ]) +AC_HAVE_DECL(readahead, [#include ]) AC_CACHE_CHECK([for secure mkstemp],samba_cv_HAVE_SECURE_MKSTEMP,[ AC_TRY_RUN([#include 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); -- cgit