Use rlimit_cur as rlimit_max is set to MAX_LONG

This commit is contained in:
s1341 2021-06-09 10:36:15 +03:00
parent cbf271d99f
commit 609939b5ec

View File

@ -212,7 +212,7 @@ impl AsanRuntime {
};
assert!(unsafe { getrlimit(RLIMIT_STACK, &mut stack_rlimit as *mut rlimit) } == 0);
stack_rlimit.rlim_max as usize
stack_rlimit.rlim_cur as usize
}
/// Get the maximum stack size for the current stack
@ -225,7 +225,7 @@ impl AsanRuntime {
};
assert!(unsafe { getrlimit64(RLIMIT_STACK, &mut stack_rlimit as *mut rlimit64) } == 0);
stack_rlimit.rlim_max as usize
stack_rlimit.rlim_cur as usize
}
/// Determine the stack start, end for the currently running thread