From 464b2e2364919f4555d6f8c5025273afd4277366 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 28 Jan 2014 11:48:30 +0100 Subject: 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. --- src/libstd/libc.rs | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src/libstd') 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 { } -- cgit 1.4.1-3-g733a5