about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-01-29 15:38:40 +0000
committerbors <bors@rust-lang.org>2016-01-29 15:38:40 +0000
commit61441cb12489faca4ee84f219b5ff9316befcb6c (patch)
tree7759d1475a39564682eabaccfc7c2368d2202a0a /src/libstd/sys
parentebe92e55f7113c5e444c7b68802d296862cc51ef (diff)
parent7a0e490bdd9a9c41a1293836e8bd826ddad90fd0 (diff)
downloadrust-61441cb12489faca4ee84f219b5ff9316befcb6c.tar.gz
rust-61441cb12489faca4ee84f219b5ff9316befcb6c.zip
Auto merge of #31285 - Manishearth:rollup, r=Manishearth
- Successful merges: #31252, #31256, #31264, #31269, #31272, #31275, #31276
- Failed merges:
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/thread.rs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs
index 9e28cf06d61..0faa1465c32 100644
--- a/src/libstd/sys/unix/thread.rs
+++ b/src/libstd/sys/unix/thread.rs
@@ -15,7 +15,6 @@ use cmp;
 #[cfg(not(target_env = "newlib"))]
 use ffi::CString;
 use io;
-use libc::PTHREAD_STACK_MIN;
 use libc;
 use mem;
 use ptr;
@@ -339,14 +338,20 @@ fn min_stack_size(attr: *const libc::pthread_attr_t) -> usize {
     });
 
     match unsafe { __pthread_get_minstack } {
-        None => PTHREAD_STACK_MIN as usize,
+        None => libc::PTHREAD_STACK_MIN as usize,
         Some(f) => unsafe { f(attr) as usize },
     }
 }
 
 // No point in looking up __pthread_get_minstack() on non-glibc
 // platforms.
-#[cfg(not(target_os = "linux"))]
+#[cfg(all(not(target_os = "linux"),
+          not(target_os = "netbsd")))]
+fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
+    libc::PTHREAD_STACK_MIN as usize
+}
+
+#[cfg(target_os = "netbsd")]
 fn min_stack_size(_: *const libc::pthread_attr_t) -> usize {
-    PTHREAD_STACK_MIN as usize
+    2048 // just a guess
 }