diff options
| author | Fenrir <[email protected]> | 2018-01-21 14:06:28 -0700 |
|---|---|---|
| committer | FenrirWolf <[email protected]> | 2018-01-21 19:16:33 -0700 |
| commit | 23be3f4885688e5e0011005e2295c75168854c0a (patch) | |
| tree | dd0850f9c73c489e114a761d5c0757f3dbec3a65 /ctr-std/src/sys_common/mod.rs | |
| parent | Update CI for Rust nightly-2017-12-01 + other fixes (diff) | |
| download | ctru-rs-23be3f4885688e5e0011005e2295c75168854c0a.tar.xz ctru-rs-23be3f4885688e5e0011005e2295c75168854c0a.zip | |
Recreate ctr-std from latest nightly
Diffstat (limited to 'ctr-std/src/sys_common/mod.rs')
| -rw-r--r-- | ctr-std/src/sys_common/mod.rs | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/ctr-std/src/sys_common/mod.rs b/ctr-std/src/sys_common/mod.rs index 4a7d79f..27504d3 100644 --- a/ctr-std/src/sys_common/mod.rs +++ b/ctr-std/src/sys_common/mod.rs @@ -10,7 +10,7 @@ //! Platform-independent platform abstraction //! -//! This is the platform-independent portion of the standard libraries +//! This is the platform-independent portion of the standard library's //! platform abstraction layer, whereas `std::sys` is the //! platform-specific portion. //! @@ -23,11 +23,16 @@ //! `std::sys` from the standard library. #![allow(missing_docs)] +#![allow(missing_debug_implementations)] + +use sync::Once; +use sys; pub mod at_exit_imp; +#[cfg(feature = "backtrace")] +pub mod backtrace; pub mod condvar; pub mod io; -pub mod memchr; pub mod mutex; pub mod poison; pub mod remutex; @@ -36,6 +41,25 @@ pub mod thread; pub mod thread_info; pub mod thread_local; pub mod util; +pub mod wtf8; +pub mod bytestring; +pub mod process; + +cfg_if! { + if #[cfg(any(target_os = "cloudabi", target_os = "l4re", target_os = "redox"))] { + pub use sys::net; + } else if #[cfg(all(target_arch = "wasm32", not(target_os = "emscripten")))] { + pub use sys::net; + } else { + pub mod net; + } +} + +#[cfg(feature = "backtrace")] +#[cfg(any(all(unix, not(target_os = "emscripten")), + all(windows, target_env = "gnu"), + target_os = "redox"))] +pub mod gnu; // common error constructors @@ -81,6 +105,16 @@ macro_rules! rtabort { ($($t:tt)*) => (::sys_common::util::abort(format_args!($($t)*))) } +/// One-time runtime cleanup. +pub fn cleanup() { + static CLEANUP: Once = Once::new(); + CLEANUP.call_once(|| unsafe { + sys::args::cleanup(); + sys::stack_overflow::cleanup(); + at_exit_imp::cleanup(); + }); +} + // Computes (value*numer)/denom without overflow, as long as both // (numer*denom) and the overall result fit into i64 (which is the case // for our time conversions). |