diff options
Diffstat (limited to 'library/std/src/sys/pal/unix/mod.rs')
| -rw-r--r-- | library/std/src/sys/pal/unix/mod.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index 7f5a8d0ce85..4898bdd2fa3 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -1,8 +1,7 @@ #![allow(missing_docs, nonstandard_style)] -use crate::io::ErrorKind; - pub use self::rand::hashmap_random_keys; +use crate::io::ErrorKind; #[cfg(not(target_os = "espidf"))] #[macro_use] @@ -86,11 +85,12 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { target_vendor = "apple", )))] 'poll: { - use crate::sys::os::errno; #[cfg(not(all(target_os = "linux", target_env = "gnu")))] use libc::open as open64; #[cfg(all(target_os = "linux", target_env = "gnu"))] use libc::open64; + + use crate::sys::os::errno; let pfds: &mut [_] = &mut [ libc::pollfd { fd: 0, events: 0, revents: 0 }, libc::pollfd { fd: 1, events: 0, revents: 0 }, @@ -140,11 +140,12 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { target_os = "vita", )))] { - use crate::sys::os::errno; #[cfg(not(all(target_os = "linux", target_env = "gnu")))] use libc::open as open64; #[cfg(all(target_os = "linux", target_env = "gnu"))] use libc::open64; + + use crate::sys::os::errno; for fd in 0..3 { if libc::fcntl(fd, libc::F_GETFD) == -1 && errno() == libc::EBADF { if open64(c"/dev/null".as_ptr().cast(), libc::O_RDWR, 0) == -1 { @@ -232,12 +233,13 @@ pub unsafe fn cleanup() { stack_overflow::cleanup(); } -#[cfg(target_os = "android")] -pub use crate::sys::android::signal; #[allow(unused_imports)] #[cfg(not(target_os = "android"))] pub use libc::signal; +#[cfg(target_os = "android")] +pub use crate::sys::android::signal; + #[inline] pub(crate) fn is_interrupted(errno: i32) -> bool { errno == libc::EINTR |
