diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2016-08-14 20:29:49 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-14 20:29:49 +0300 |
| commit | 8ade28e9a26a27153bda67cd5213411bfbd95ff3 (patch) | |
| tree | 972c008b61710f32382c2132641f7433048c2513 /src/libstd | |
| parent | c3cede2257424d3d1879618a784974b967491b9b (diff) | |
| parent | 60599df03b094c81923ab863c6fd616ef2c15806 (diff) | |
| download | rust-8ade28e9a26a27153bda67cd5213411bfbd95ff3.tar.gz rust-8ade28e9a26a27153bda67cd5213411bfbd95ff3.zip | |
Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brson
Emscripten test fixes This picks up parts of #31623 to disable certain tests that emscripten can't run, as threads/processes are not supported. I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants. It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach). This should not impact anything for normal builds.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/unix/mod.rs | 4 | ||||
| -rw-r--r-- | src/libstd/sys/unix/os.rs | 6 | ||||
| -rw-r--r-- | src/libstd/sys/unix/thread.rs | 7 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/libstd/sys/unix/mod.rs b/src/libstd/sys/unix/mod.rs index 1c25c8f77c1..23687e10e47 100644 --- a/src/libstd/sys/unix/mod.rs +++ b/src/libstd/sys/unix/mod.rs @@ -83,11 +83,11 @@ pub fn init() { } } - #[cfg(not(target_os = "nacl"))] + #[cfg(not(any(target_os = "nacl", target_os = "emscripten")))] unsafe fn reset_sigpipe() { assert!(signal(libc::SIGPIPE, libc::SIG_IGN) != !0); } - #[cfg(target_os = "nacl")] + #[cfg(any(target_os = "nacl", target_os = "emscripten"))] unsafe fn reset_sigpipe() {} } diff --git a/src/libstd/sys/unix/os.rs b/src/libstd/sys/unix/os.rs index 9c57f25dfcc..c29e87f91c9 100644 --- a/src/libstd/sys/unix/os.rs +++ b/src/libstd/sys/unix/os.rs @@ -551,11 +551,13 @@ pub fn home_dir() -> Option<PathBuf> { #[cfg(any(target_os = "android", target_os = "ios", - target_os = "nacl"))] + target_os = "nacl", + target_os = "emscripten"))] unsafe fn fallback() -> Option<OsString> { None } #[cfg(not(any(target_os = "android", target_os = "ios", - target_os = "nacl")))] + target_os = "nacl", + target_os = "emscripten")))] unsafe fn fallback() -> Option<OsString> { #[cfg(not(target_os = "solaris"))] unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd, diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs index 1061ca87f64..75e10d25853 100644 --- a/src/libstd/sys/unix/thread.rs +++ b/src/libstd/sys/unix/thread.rs @@ -81,8 +81,7 @@ impl Thread { } #[cfg(any(target_os = "linux", - target_os = "android", - target_os = "emscripten"))] + target_os = "android"))] pub fn set_name(name: &CStr) { const PR_SET_NAME: libc::c_int = 15; // pthread wrapper only appeared in glibc 2.12, so we use syscall @@ -118,9 +117,9 @@ impl Thread { name.as_ptr() as *mut libc::c_void); } } - #[cfg(any(target_env = "newlib", target_os = "solaris"))] + #[cfg(any(target_env = "newlib", target_os = "solaris", target_os = "emscripten"))] pub fn set_name(_name: &CStr) { - // Newlib and Illumos has no way to set a thread name. + // Newlib, Illumos and Emscripten have no way to set a thread name. } pub fn sleep(dur: Duration) { |
