std: Be resilient to failure in pthread_getattr_np

This can fail on linux for various reasons, such as the /proc filesystem not
being mounted. There are already many cases where we can't set up stack guards,
so just don't worry about this case and communicate that no guard was enabled.

I've confirmed that this allows the compiler to run in a chroot without /proc
mounted.

Closes #22642
This commit is contained in:
Alex Crichton
2015-07-16 11:59:53 -07:00
parent 39d4faf989
commit d68b152c3e
4 changed files with 62 additions and 49 deletions

View File

@@ -86,7 +86,8 @@ impl Thread {
}
pub mod guard {
pub unsafe fn main() -> usize { 0 }
pub unsafe fn current() -> usize { 0 }
pub unsafe fn init() {}
use prelude::v1::*;
pub unsafe fn current() -> Option<usize> { None }
pub unsafe fn init() -> Option<usize> { None }
}