mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 06:44:16 +01:00
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
This commit is contained in:
parent
400c9045f8
commit
492deeda11
1 changed files with 9 additions and 4 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue