Ignore if PR_SET_VMA fails
Summary: Some older kernel versions doesn't have an implementation for `PR_SET_VMA` (Confirmed for Kernel 3.4 https://fburl.com/j1pf9qgw). Mostly it happens on Android OS 5/6. Ignoring the error if that happens.
@@ -59,15 +59,14 @@ class allocator_block {
}
#ifdef ANDROID
- if (prctl(
+ // Older Linux kernels may not have the PR_SET_VMA call implementation.
+ // That's okay we just ignore errors if this call fails.
+ prctl(
PR_SET_VMA,
PR_SET_VMA_ANON_NAME,
map_,
kSize,
- "plthooks plt trampolines")) {
- throw std::system_error(
- errno, std::system_category(), "could not set VMA name");
- }
+ "plthooks plt trampolines");
#endif // ANDROID
top_ = reinterpret_cast<uint8_t*>(map_);
}
