summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2014-01-28 11:48:30 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2014-01-31 13:47:25 +0100
commit464b2e2364919f4555d6f8c5025273afd4277366 (patch)
treef75bcf3df5f9e1578d8d9888f7b892131b51f8f7 /src/libstd
parentf910a977db8fb425f9dfbfcf01438adf2a134670 (diff)
downloadrust-464b2e2364919f4555d6f8c5025273afd4277366.tar.gz
rust-464b2e2364919f4555d6f8c5025273afd4277366.zip
Add libc::consts::os::posix01::PTHREAD_STACK_MIN
Represents the minimum size of a thread's stack.  As such, it's both
platform and architecture-specific.

I put it under posix01 even though it predates POSIX.1-2001 by some
years.  I believe it was first formalized in SUSv2.  I doubt anyone
cares, though.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/libc.rs26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/libstd/libc.rs b/src/libstd/libc.rs
index dccadf2e00b..11a7b5dd191 100644
--- a/src/libstd/libc.rs
+++ b/src/libstd/libc.rs
@@ -2174,7 +2174,7 @@ pub mod consts {
             pub static EDQUOT: c_int = 1133;
         }
         pub mod posix01 {
-            use libc::types::os::arch::c95::c_int;
+            use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
 
@@ -2228,6 +2228,17 @@ pub mod consts {
             pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
             pub static PTHREAD_CREATE_DETACHED: c_int = 1;
 
+            #[cfg(target_os = "android")]
+            pub static PTHREAD_STACK_MIN: size_t = 8192;
+
+            #[cfg(target_arch = "arm", target_os = "linux")]
+            #[cfg(target_arch = "x86", target_os = "linux")]
+            #[cfg(target_arch = "x86_64", target_os = "linux")]
+            pub static PTHREAD_STACK_MIN: size_t = 16384;
+
+            #[cfg(target_arch = "mips", target_os = "linux")]
+            pub static PTHREAD_STACK_MIN: size_t = 131072;
+
             pub static CLOCK_REALTIME: c_int = 0;
             pub static CLOCK_MONOTONIC: c_int = 1;
         }
@@ -2608,7 +2619,7 @@ pub mod consts {
             pub static ELAST : c_int = 99;
         }
         pub mod posix01 {
-            use libc::types::os::arch::c95::c_int;
+            use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
 
@@ -2662,6 +2673,14 @@ pub mod consts {
             pub static PTHREAD_CREATE_JOINABLE: c_int = 0;
             pub static PTHREAD_CREATE_DETACHED: c_int = 1;
 
+            #[cfg(target_arch = "arm")]
+            pub static PTHREAD_STACK_MIN: size_t = 4096;
+
+            #[cfg(target_arch = "mips")]
+            #[cfg(target_arch = "x86")]
+            #[cfg(target_arch = "x86_64")]
+            pub static PTHREAD_STACK_MIN: size_t = 2048;
+
             pub static CLOCK_REALTIME: c_int = 0;
             pub static CLOCK_MONOTONIC: c_int = 4;
         }
@@ -2990,7 +3009,7 @@ pub mod consts {
             pub static ELAST : c_int = 106;
         }
         pub mod posix01 {
-            use libc::types::os::arch::c95::c_int;
+            use libc::types::os::arch::c95::{c_int, size_t};
 
             pub static SIGTRAP : c_int = 5;
 
@@ -3043,6 +3062,7 @@ pub mod consts {
 
             pub static PTHREAD_CREATE_JOINABLE: c_int = 1;
             pub static PTHREAD_CREATE_DETACHED: c_int = 2;
+            pub static PTHREAD_STACK_MIN: size_t = 8192;
         }
         pub mod posix08 {
         }