1 //! I/O operations. 2 3 mod close; 4 #[cfg(any(target_os = "android", target_os = "linux"))] 5 pub(crate) mod context; 6 #[cfg(not(windows))] 7 mod dup; 8 mod errno; 9 #[cfg(any(target_os = "android", target_os = "linux"))] 10 mod eventfd; 11 #[cfg(not(windows))] 12 mod fcntl; 13 #[cfg(not(feature = "std"))] 14 pub(crate) mod fd; 15 mod ioctl; 16 #[cfg(not(any(windows, target_os = "redox")))] 17 mod is_read_write; 18 #[cfg(not(any(windows, target_os = "wasi")))] 19 mod pipe; 20 mod poll; 21 #[cfg(all(feature = "procfs", any(target_os = "android", target_os = "linux")))] 22 mod procfs; 23 #[cfg(not(windows))] 24 mod read_write; 25 #[cfg(not(feature = "std"))] 26 mod seek_from; 27 #[cfg(not(windows))] 28 mod stdio; 29 30 #[cfg(any(target_os = "android", target_os = "linux"))] 31 pub use crate::backend::io::epoll; 32 pub use close::close; 33 #[cfg(not(any(windows, target_os = "aix", target_os = "wasi")))] 34 pub use dup::{dup, dup2, dup3, DupFlags}; 35 pub use errno::{retry_on_intr, Errno, Result}; 36 #[cfg(any(target_os = "android", target_os = "linux"))] 37 pub use eventfd::{eventfd, EventfdFlags}; 38 #[cfg(not(any(windows, target_os = "wasi")))] 39 pub use fcntl::fcntl_dupfd_cloexec; 40 #[cfg(not(windows))] 41 pub use fcntl::{fcntl_getfd, fcntl_setfd, FdFlags}; 42 #[cfg(any(target_os = "ios", target_os = "macos"))] 43 pub use ioctl::ioctl_fioclex; 44 pub use ioctl::ioctl_fionbio; 45 #[cfg(not(target_os = "redox"))] 46 pub use ioctl::ioctl_fionread; 47 #[cfg(any(target_os = "android", target_os = "linux"))] 48 pub use ioctl::{ioctl_blkpbszget, ioctl_blksszget}; 49 #[cfg(not(any(windows, target_os = "haiku", target_os = "redox", target_os = "wasi")))] 50 pub use ioctl::{ioctl_tiocexcl, ioctl_tiocnxcl}; 51 #[cfg(not(any(windows, target_os = "redox")))] 52 #[cfg(all(feature = "fs", feature = "net"))] 53 pub use is_read_write::is_read_write; 54 #[cfg(not(any(windows, target_os = "wasi")))] 55 pub use pipe::pipe; 56 #[cfg(not(any( 57 windows, 58 target_os = "haiku", 59 target_os = "illumos", 60 target_os = "redox", 61 target_os = "solaris", 62 target_os = "wasi", 63 )))] 64 pub use pipe::PIPE_BUF; 65 #[cfg(not(any( 66 windows, 67 target_os = "aix", 68 target_os = "haiku", 69 target_os = "ios", 70 target_os = "macos", 71 target_os = "wasi" 72 )))] 73 pub use pipe::{pipe_with, PipeFlags}; 74 #[cfg(any(target_os = "android", target_os = "linux"))] 75 pub use pipe::{splice, vmsplice, IoSliceRaw, SpliceFlags}; 76 pub use poll::{poll, PollFd, PollFlags}; 77 #[cfg(all(feature = "procfs", any(target_os = "android", target_os = "linux")))] 78 pub use procfs::{ 79 proc_self_fd, proc_self_fdinfo_fd, proc_self_maps, proc_self_pagemap, proc_self_status, 80 }; 81 #[cfg(not(windows))] 82 pub use read_write::{pread, pwrite, read, readv, write, writev, IoSlice, IoSliceMut}; 83 #[cfg(not(any( 84 windows, 85 target_os = "haiku", 86 target_os = "redox", 87 target_os = "solaris" 88 )))] 89 pub use read_write::{preadv, pwritev}; 90 #[cfg(any(target_os = "android", target_os = "linux"))] 91 pub use read_write::{preadv2, pwritev2, ReadWriteFlags}; 92 #[cfg(not(feature = "std"))] 93 pub use seek_from::SeekFrom; 94 #[cfg(feature = "std")] 95 pub use std::io::SeekFrom; 96 #[cfg(not(windows))] 97 pub use stdio::{ 98 raw_stderr, raw_stdin, raw_stdout, stderr, stdin, stdout, take_stderr, take_stdin, take_stdout, 99 }; 100