From 6f54ce9aa5d2baf0cd82c01e2c181ab17439b7d7 Mon Sep 17 00:00:00 2001 From: pez Date: Mon, 13 Apr 2015 14:24:47 +0100 Subject: [PATCH 1/2] added _SC_NPROCESSORS_ONLN constants for linux and macos for fix #24374 --- src/liblibc/lib.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 040c9b011f3..310b7439613 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -3344,6 +3344,8 @@ pub mod posix01 { pub const _SC_XOPEN_REALTIME : c_int = 130; pub const _SC_XOPEN_REALTIME_THREADS : c_int = 131; + + pub const PTHREAD_CREATE_JOINABLE: c_int = 0; pub const PTHREAD_CREATE_DETACHED: c_int = 1; @@ -3742,6 +3744,19 @@ pub mod sysconf { pub static _SC_NPROCESSORS_ONLN : c_int = 1; pub static _SC_PAGESIZE : c_int = 2; } + + #[cfg(target_os = "linux")] + pub mod sysconf { + use types::os::arch::c95::c_int; + pub static _SC_NPROCESSORS_ONLN : c_int = 84; + } + + #[cfg(target_os = "macos")] + pub mod sysconf { + use types::os::arch::c95::c_int; + pub static _SC_NPROCESSORS_ONLN : c_int = 58; + } + #[cfg(target_os = "android")] pub mod sysconf { use types::os::arch::c95::c_int; From 883bb6568d2b5659de197cea612656f757fc22af Mon Sep 17 00:00:00 2001 From: pez Date: Mon, 13 Apr 2015 15:17:45 +0100 Subject: [PATCH 2/2] remove duplicated linux sysconf mod --- src/liblibc/lib.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/liblibc/lib.rs b/src/liblibc/lib.rs index 310b7439613..ba3a6831d8c 100644 --- a/src/liblibc/lib.rs +++ b/src/liblibc/lib.rs @@ -3729,12 +3729,14 @@ pub mod sysconf { pub const _SC_2_FORT_RUN : c_int = 50; pub const _SC_2_SW_DEV : c_int = 51; pub const _SC_2_LOCALEDEF : c_int = 52; + pub const _SC_NPROCESSORS_ONLN : c_int = 84; pub const _SC_2_CHAR_TERM : c_int = 95; pub const _SC_2_C_VERSION : c_int = 96; pub const _SC_2_UPE : c_int = 97; pub const _SC_XBS5_ILP32_OFF32 : c_int = 125; pub const _SC_XBS5_ILP32_OFFBIG : c_int = 126; pub const _SC_XBS5_LPBIG_OFFBIG : c_int = 128; + } #[cfg(target_os = "nacl")] pub mod sysconf { @@ -3745,12 +3747,6 @@ pub mod sysconf { pub static _SC_PAGESIZE : c_int = 2; } - #[cfg(target_os = "linux")] - pub mod sysconf { - use types::os::arch::c95::c_int; - pub static _SC_NPROCESSORS_ONLN : c_int = 84; - } - #[cfg(target_os = "macos")] pub mod sysconf { use types::os::arch::c95::c_int;