| 1 | #![forbid (unsafe_op_in_unsafe_fn)] |
| 2 | |
| 3 | mod io_slice { |
| 4 | cfg_select! { |
| 5 | any(target_family = "unix" , target_os = "hermit" , target_os = "solid_asp3" , target_os = "trusty" ) => { |
| 6 | mod iovec; |
| 7 | pub use iovec::*; |
| 8 | } |
| 9 | target_os = "windows" => { |
| 10 | mod windows; |
| 11 | pub use windows::*; |
| 12 | } |
| 13 | target_os = "wasi" => { |
| 14 | mod wasi; |
| 15 | pub use wasi::*; |
| 16 | } |
| 17 | target_os = "uefi" => { |
| 18 | mod uefi; |
| 19 | pub use uefi::*; |
| 20 | } |
| 21 | _ => { |
| 22 | mod unsupported; |
| 23 | pub use unsupported::*; |
| 24 | } |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | mod is_terminal { |
| 29 | cfg_select! { |
| 30 | any(target_family = "unix" , target_os = "wasi" ) => { |
| 31 | mod isatty; |
| 32 | pub use isatty::*; |
| 33 | } |
| 34 | target_os = "windows" => { |
| 35 | mod windows; |
| 36 | pub use windows::*; |
| 37 | } |
| 38 | target_os = "hermit" => { |
| 39 | mod hermit; |
| 40 | pub use hermit::*; |
| 41 | } |
| 42 | target_os = "motor" => { |
| 43 | mod motor; |
| 44 | pub use motor::*; |
| 45 | } |
| 46 | _ => { |
| 47 | mod unsupported; |
| 48 | pub use unsupported::*; |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | mod kernel_copy; |
| 54 | |
| 55 | pub use io_slice::{IoSlice, IoSliceMut}; |
| 56 | pub use is_terminal::is_terminal; |
| 57 | pub use kernel_copy::{CopyState, kernel_copy}; |
| 58 | |
| 59 | // Bare metal platforms usually have very small amounts of RAM |
| 60 | // (in the order of hundreds of KB) |
| 61 | pub const DEFAULT_BUF_SIZE: usize = if cfg!(target_os = "espidf" ) { 512 } else { 8 * 1024 }; |
| 62 | |