Skip to content

Commit

Permalink
Add libc::consts::os::posix01::PTHREAD_STACK_MIN
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bnoordhuis committed Jan 31, 2014
1 parent f910a97 commit 464b2e2
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/libstd/libc.rs
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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 {
}
Expand Down

0 comments on commit 464b2e2

Please sign in to comment.