aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraglitke <aglitke@aglitke.localdomain>2006-09-13 13:53:17 -0500
committeraglitke <aglitke@aglitke.localdomain>2006-09-13 13:53:17 -0500
commitf9f27139e54ad7a7a0e09a3ef5cb6dcebe16c002 (patch)
tree2e2e214f69e0a808c40f0d760d1e222b9adf72a5
parentd109349663491a6be7e6741837e8d520e59d2bb4 (diff)
downloadlibhugetlbfs-dev-20060913-1.tar.gz
morecore: Fixup HUGETLB_MORECORE semanticsdev-20060913-1
Currently, morecore is enabled, if HUGETLB_MORECORE is set at all in the environment, even if its value is "no". That is counterintuitive, as none of the other environment variables work that way. Make HUGETLB_MORECORE act like HUGETLB_ELFMAP. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
-rw-r--r--morecore.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/morecore.c b/morecore.c
index 0574a7c..39322a6 100644
--- a/morecore.c
+++ b/morecore.c
@@ -26,6 +26,7 @@
#include <sys/mman.h>
#include <errno.h>
#include <dlfcn.h>
+#include <string.h>
#include "hugetlbfs.h"
@@ -134,6 +135,11 @@ static void __attribute__((constructor)) setup_morecore(void)
env = getenv("HUGETLB_MORECORE");
if (! env)
return;
+ if (strcasecmp(env, "no") == 0) {
+ DEBUG("HUGETLB_MORECORE=%s, not setting up morecore\n",
+ env);
+ return;
+ }
blocksize = gethugepagesize();
if (! blocksize) {