| 1 |
//! Filesystem operations. |
| 2 |
|
| 3 |
mod abs; |
| 4 |
mod at; |
| 5 |
mod constants; |
| 6 |
#[cfg(linux_kernel)] |
| 7 |
mod copy_file_range; |
| 8 |
#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))] |
| 9 |
mod dir; |
| 10 |
#[cfg(not(any( |
| 11 |
apple, |
| 12 |
netbsdlike, |
| 13 |
target_os = "dragonfly", |
| 14 |
target_os = "espidf", |
| 15 |
target_os = "haiku", |
| 16 |
target_os = "horizon", |
| 17 |
target_os = "redox", |
| 18 |
target_os = "solaris", |
| 19 |
target_os = "vita", |
| 20 |
)))] |
| 21 |
mod fadvise; |
| 22 |
pub(crate) mod fcntl; |
| 23 |
#[cfg(apple)] |
| 24 |
mod fcntl_apple; |
| 25 |
#[cfg(apple)] |
| 26 |
mod fcopyfile; |
| 27 |
pub(crate) mod fd; |
| 28 |
#[cfg(all(apple, feature = "alloc"))] |
| 29 |
mod getpath; |
| 30 |
#[cfg(not(target_os = "wasi"))] // WASI doesn't have get[gpu]id. |
| 31 |
mod id; |
| 32 |
#[cfg(linux_raw_dep)] |
| 33 |
pub mod inotify; |
| 34 |
#[cfg(linux_kernel)] |
| 35 |
mod ioctl; |
| 36 |
#[cfg(not(any( |
| 37 |
target_os = "espidf", |
| 38 |
target_os = "haiku", |
| 39 |
target_os = "horizon", |
| 40 |
target_os = "vita", |
| 41 |
target_os = "wasi" |
| 42 |
)))] |
| 43 |
mod makedev; |
| 44 |
#[cfg(any(linux_kernel, target_os = "freebsd"))] |
| 45 |
mod memfd_create; |
| 46 |
#[cfg(linux_raw_dep)] |
| 47 |
mod openat2; |
| 48 |
#[cfg(linux_kernel)] |
| 49 |
mod raw_dir; |
| 50 |
mod seek_from; |
| 51 |
#[cfg(target_os = "linux")] |
| 52 |
mod sendfile; |
| 53 |
#[cfg(not(target_os = "espidf"))] |
| 54 |
mod special; |
| 55 |
#[cfg(linux_kernel)] |
| 56 |
mod statx; |
| 57 |
#[cfg(not(any( |
| 58 |
target_os = "espidf", |
| 59 |
target_os = "horizon", |
| 60 |
target_os = "redox", |
| 61 |
target_os = "vita", |
| 62 |
target_os = "wasi" |
| 63 |
)))] |
| 64 |
mod sync; |
| 65 |
#[cfg(any(apple, linux_kernel, target_os = "hurd"))] |
| 66 |
mod xattr; |
| 67 |
|
| 68 |
pub use abs::*; |
| 69 |
pub use at::*; |
| 70 |
pub use constants::*; |
| 71 |
#[cfg(linux_kernel)] |
| 72 |
pub use copy_file_range::copy_file_range; |
| 73 |
#[cfg(all(feature = "alloc", not(any(target_os = "espidf", target_os = "redox"))))] |
| 74 |
pub use dir::{Dir, DirEntry}; |
| 75 |
#[cfg(not(any( |
| 76 |
apple, |
| 77 |
netbsdlike, |
| 78 |
target_os = "dragonfly", |
| 79 |
target_os = "espidf", |
| 80 |
target_os = "haiku", |
| 81 |
target_os = "horizon", |
| 82 |
target_os = "redox", |
| 83 |
target_os = "solaris", |
| 84 |
target_os = "vita", |
| 85 |
)))] |
| 86 |
pub use fadvise::fadvise; |
| 87 |
pub use fcntl::*; |
| 88 |
#[cfg(apple)] |
| 89 |
pub use fcntl_apple::*; |
| 90 |
#[cfg(apple)] |
| 91 |
pub use fcopyfile::*; |
| 92 |
pub use fd::*; |
| 93 |
#[cfg(all(apple, feature = "alloc"))] |
| 94 |
pub use getpath::getpath; |
| 95 |
#[cfg(not(target_os = "wasi"))] |
| 96 |
pub use id::*; |
| 97 |
#[cfg(linux_kernel)] |
| 98 |
pub use ioctl::*; |
| 99 |
#[cfg(not(any( |
| 100 |
target_os = "espidf", |
| 101 |
target_os = "haiku", |
| 102 |
target_os = "horizon", |
| 103 |
target_os = "vita", |
| 104 |
target_os = "wasi" |
| 105 |
)))] |
| 106 |
pub use makedev::*; |
| 107 |
#[cfg(any(linux_kernel, target_os = "freebsd"))] |
| 108 |
pub use memfd_create::memfd_create; |
| 109 |
#[cfg(linux_raw_dep)] |
| 110 |
pub use openat2::openat2; |
| 111 |
#[cfg(linux_kernel)] |
| 112 |
pub use raw_dir::{RawDir, RawDirEntry}; |
| 113 |
pub use seek_from::SeekFrom; |
| 114 |
#[cfg(target_os = "linux")] |
| 115 |
pub use sendfile::sendfile; |
| 116 |
#[cfg(not(target_os = "espidf"))] |
| 117 |
pub use special::*; |
| 118 |
#[cfg(linux_kernel)] |
| 119 |
pub use statx::*; |
| 120 |
#[cfg(not(any( |
| 121 |
target_os = "espidf", |
| 122 |
target_os = "horizon", |
| 123 |
target_os = "redox", |
| 124 |
target_os = "vita", |
| 125 |
target_os = "wasi" |
| 126 |
)))] |
| 127 |
pub use sync::sync; |
| 128 |
#[cfg(any(apple, linux_kernel, target_os = "hurd"))] |
| 129 |
pub use xattr::*; |
| 130 |
|
| 131 |
/// Re-export types common to POSIX-ish platforms. |
| 132 |
#[cfg(feature = "std")] |
| 133 |
#[cfg(unix)] |
| 134 |
pub use std::os::unix::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt}; |
| 135 |
#[cfg(feature = "std")] |
| 136 |
#[cfg(all(wasi_ext, target_os = "wasi"))] |
| 137 |
pub use std::os::wasi::fs::{DirEntryExt, FileExt, FileTypeExt, MetadataExt, OpenOptionsExt}; |