Skip to main content

std/sys/io/
mod.rs

1#![forbid(unsafe_op_in_unsafe_fn)]
2
3mod error;
4
5mod is_terminal {
6    cfg_select! {
7        any(target_family = "unix", target_os = "wasi") => {
8            mod isatty;
9            pub use isatty::*;
10        }
11        target_os = "windows" => {
12            mod windows;
13            pub use windows::*;
14        }
15        target_os = "hermit" => {
16            mod hermit;
17            pub use hermit::*;
18        }
19        target_os = "motor" => {
20            mod motor;
21            pub use motor::*;
22        }
23        _ => {
24            mod unsupported;
25            pub use unsupported::*;
26        }
27    }
28}
29
30mod kernel_copy;
31
32#[allow(unused_imports, reason = "only used by certain target configurations")]
33pub use alloc_crate::io::DEFAULT_BUF_SIZE;
34#[cfg_attr(not(target_os = "linux"), allow(unused_imports))]
35#[cfg(all(
36    target_family = "unix",
37    not(any(target_os = "dragonfly", target_os = "vxworks", target_os = "rtems"))
38))]
39pub use error::errno_location;
40#[cfg_attr(not(target_os = "linux"), allow(unused_imports))]
41#[cfg(any(
42    all(target_family = "unix", not(any(target_os = "vxworks", target_os = "rtems"))),
43    target_os = "wasi",
44))]
45pub use error::set_errno;
46pub use error::{decode_error_kind, errno, error_string, is_interrupted};
47pub use is_terminal::is_terminal;
48pub use kernel_copy::{CopyState, kernel_copy};