[Pkg-clamav-commits] [SCM] Debian repository for ClamAV branch, debian/unstable, updated. debian/0.95+dfsg-1-6156-g094ec9b
aCaB
acab at clamav.net
Sun Apr 4 01:07:36 UTC 2010
The following commit has been merged in the debian/unstable branch:
commit 2de5c29b1b10b57ee7c6fa717bd2557101fce641
Author: aCaB <acab at clamav.net>
Date: Sat Oct 10 16:37:55 2009 +0200
check for madvise()
diff --git a/clamav-config.h.in b/clamav-config.h.in
index e14726d..8183067 100644
--- a/clamav-config.h.in
+++ b/clamav-config.h.in
@@ -250,6 +250,9 @@
/* Define to 1 if you have the <mach-o/dyld.h> header file. */
#undef HAVE_MACH_O_DYLD_H
+/* Define to 1 if you have the `madvise' function. */
+#undef HAVE_MADVISE
+
/* Define to 1 if you have the `mallinfo' function. */
#undef HAVE_MALLINFO
diff --git a/configure b/configure
index 3571bc8..9296aca 100755
--- a/configure
+++ b/configure
@@ -13508,7 +13508,7 @@ if test "$ac_res" != no; then :
fi
-for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo
+for ac_func in poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.in b/configure.in
index 8d41b10..da98c3c 100644
--- a/configure.in
+++ b/configure.in
@@ -432,7 +432,7 @@ fi
AC_CHECK_LIB([socket], [bind], [LIBS="$LIBS -lsocket"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lsocket"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lsocket"; CLAMD_LIBS="$CLAMD_LIBS -lsocket"])
AC_SEARCH_LIBS([gethostent],[nsl], [(LIBS="$LIBS -lnsl"; CLAMAV_MILTER_LIBS="$CLAMAV_MILTER_LIBS -lnsl"; FRESHCLAM_LIBS="$FRESHCLAM_LIBS -lnsl"; CLAMD_LIBS="$CLAMD_LIBS -lnsl")])
-AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo])
+AC_CHECK_FUNCS([poll setsid memcpy snprintf vsnprintf strerror_r strlcpy strlcat strcasestr inet_ntop setgroups initgroups ctime_r mkstemp mallinfo madvise])
AC_FUNC_FSEEKO
dnl Check if anon maps are available, check if we can determine the page size
diff --git a/libclamav/fmap.c b/libclamav/fmap.c
index 5a2f675..f4db164 100644
--- a/libclamav/fmap.c
+++ b/libclamav/fmap.c
@@ -57,7 +57,7 @@
#define UNPAGE_THRSHLD_HI 8*1024*1024
#define READAHEAD_PAGES 8
-#ifdef C_LINUX
+#if defined(HAVE_MMAP) && defined(C_LINUX)
/*
WORKAROUND
Relieve some stress on mmap_sem.
@@ -72,6 +72,10 @@ pthread_mutex_t fmap_mutex = PTHREAD_MUTEX_INITIALIZER;
#define fmap_unlock
#endif
+#ifndef MADV_DONTFORK
+#define MADV_DONTFORK 0
+#endif
+
#define fmap_bitmap (&m->placeholder_for_bitmap)
/* pread proto here in order to avoid the use of XOPEN and BSD_SOURCE
@@ -123,11 +127,13 @@ fmap_t *fmap(int fd, off_t offset, size_t len) {
m = NULL;
} else {
dumb = 0;
+#if HAVE_MADVISE
madvise(m, mapsz, MADV_RANDOM|MADV_DONTFORK);
+#endif /* madvise */
}
-#else
+#else /* ! HAVE_MMAP */
m = (fmap_t *)cli_malloc(mapsz);
-#endif
+#endif /* HAVE_MMAP */
if(!m) {
cli_warnmsg("fmap: map allocation failed\n");
fmap_unlock;
--
Debian repository for ClamAV
More information about the Pkg-clamav-commits
mailing list