summaryrefslogtreecommitdiffstats
path: root/source3/configure.in
diff options
context:
space:
mode:
authortodd stecher <todd.stecher@gmail.com>2009-02-17 16:16:35 -0800
committerSteven Danneman <steven.danneman@isilon.com>2009-02-18 18:08:32 -0800
commitc441f58dedc465f59060296815a0bc7f9aeb743f (patch)
treef6443ed770146ba26e9c09370c1a9bddc22252fe /source3/configure.in
parentcdcd525a05ce851dcb338dfa8c9be3009194aa96 (diff)
downloadsamba-c441f58dedc465f59060296815a0bc7f9aeb743f.tar.gz
samba-c441f58dedc465f59060296815a0bc7f9aeb743f.tar.xz
samba-c441f58dedc465f59060296815a0bc7f9aeb743f.zip
S3: Allow SMBD processes to survive in low memory condidtions
This commit adds a configure argument which allows for setting MADV_PROTECT in the madvise() API. With this enabled the kernel won't kill SMBD when it's running low on memory.
Diffstat (limited to 'source3/configure.in')
-rw-r--r--source3/configure.in28
1 files changed, 28 insertions, 0 deletions
diff --git a/source3/configure.in b/source3/configure.in
index 691d0a80bc4..57d475fcc58 100644
--- a/source3/configure.in
+++ b/source3/configure.in
@@ -4718,6 +4718,34 @@ SMB_LIBRARY(lua, 0)
SMB_LIBRARY(addns, 0, no, [undefined API])
+#################################################
+# check to see if we should set the protected madvise flag,
+# which will keep smbd alive in low memory conditions
+AC_MSG_CHECKING(whether to protect smbd from being killed in low memory)
+AC_ARG_WITH(madvise-protect,
+[AS_HELP_STRING([--with-madvise-protect], [Include low memory madvise protection (default=no)])],
+[ case "$withval" in
+ yes)
+ AC_TRY_COMPILE([
+ #include <sys/mman.h>
+ ],[
+ int a = MADV_PROTECT;
+ ],
+ [samba_cv_madvise_protect=yes],
+ [samba_cv_madvise_protect=no])
+ if test x"$samba_cv_madvise_protect" = x"yes"; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WITH_MADVISE_PROTECTED,1,[Whether to include low memory protection support])
+ else
+ AC_MSG_ERROR(Low memory protection supporte requires availability of MADVISE_PROTECT flag.)
+ fi
+ ;;
+ *)
+ AC_MSG_RESULT(no)
+ ;;
+ esac ],
+ AC_MSG_RESULT(no)
+)
#################################################
# these tests are taken from the GNU fileutils package