-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
#![allow(dead_code, missing_docs, nonstandard_style)]
-use io::{self, ErrorKind};
+use crate::io::ErrorKind;
pub use libc::strlen;
pub use self::rand::hashmap_random_keys;
pub mod fast_thread_local;
pub mod fd;
pub mod fs;
+pub mod io;
pub mod memchr;
pub mod mutex;
pub mod net;
pub mod os;
-pub mod os_str;
pub mod path;
pub mod pipe;
pub mod process;
pub mod thread_local;
pub mod time;
+pub use crate::sys_common::os_str_bytes as os_str;
+
#[cfg(not(test))]
pub fn init() {}
}
}
-pub fn cvt(result: Result<usize, syscall::Error>) -> io::Result<usize> {
- result.map_err(|err| io::Error::from_raw_os_error(err.errno))
+pub fn cvt(result: Result<usize, syscall::Error>) -> crate::io::Result<usize> {
+ result.map_err(|err| crate::io::Error::from_raw_os_error(err.errno))
}
#[doc(hidden)]
impl_is_minus_one! { i8 i16 i32 i64 isize }
-pub fn cvt_libc<T: IsMinusOne>(t: T) -> io::Result<T> {
+pub fn cvt_libc<T: IsMinusOne>(t: T) -> crate::io::Result<T> {
if t.is_minus_one() {
- Err(io::Error::last_os_error())
+ Err(crate::io::Error::last_os_error())
} else {
Ok(t)
}
/// On Redox, use an illegal instruction to abort
pub unsafe fn abort_internal() -> ! {
- ::core::intrinsics::abort();
+ core::intrinsics::abort();
}