about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-07-16 11:59:53 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-21 09:18:30 -0700
commitd68b152c3e2feb6ee18bdf2c992098376dbb528c (patch)
tree535bd20cf5b0c241227ab828a8580f2bd1ab38d2 /src/libstd/sys/windows
parent39d4faf989cea236e2e1669ab85d060d1c62cd85 (diff)
downloadrust-d68b152c3e2feb6ee18bdf2c992098376dbb528c.tar.gz
rust-d68b152c3e2feb6ee18bdf2c992098376dbb528c.zip
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
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/thread.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs
index 50dfee4ab10..42805c2ac52 100644
--- a/src/libstd/sys/windows/thread.rs
+++ b/src/libstd/sys/windows/thread.rs
@@ -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 }
 }