Commit 492deeda authored by Rich Prohaska's avatar Rich Prohaska Committed by Yoni Fogel

test os_get_process_data_size on 32 bit linux. addresses #1387

git-svn-id: file:///svn/toku/tokudb@8747 c7de825b-a66e-492c-adef-691d508d4ae1
parent 400c9045
...@@ -176,11 +176,16 @@ toku_os_get_max_process_data_size(uint64_t *maxdata) { ...@@ -176,11 +176,16 @@ toku_os_get_max_process_data_size(uint64_t *maxdata) {
r = getrlimit(RLIMIT_DATA, &rlimit); r = getrlimit(RLIMIT_DATA, &rlimit);
if (r == 0) { if (r == 0) {
*maxdata = rlimit.rlim_max; uint64_t d;
d = rlimit.rlim_max;
// with the "right" macros defined, the rlimit is a 64 bit number on a
// 32 bit system. getrlimit returns 2**64-1 which is clearly wrong.
// for 32 bit processes, we assume that 1/2 of the address space is // for 32 bit processes, we assume that 1/2 of the address space is
// used for mapping the kernel. // used for mapping the kernel. this may be pessimistic.
if (sizeof (rlimit.rlim_max) == 4 && rlimit.rlim_max == 0xffffffff) if (sizeof (void *) == 4 && d > (1ULL << 31))
*maxdata /= 2; d = 1ULL << 31;
*maxdata = d;
} else } else
r = errno; r = errno;
return r; return r;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment