• Home
  • Raw
  • Download

Lines Matching +full:bare +full:- +full:fs

1 //! `rustix` provides efficient memory-safe and [I/O-safe] wrappers to
2 //! POSIX-like, Unix-like, Linux, and Winsock syscall-like APIs, with
9 //! # fn read(sock: std::net::TcpStream, buf: &mut [u8]) -> std::io::Result<()> {
21 //! # fn read(sock: std::net::TcpStream, buf: &mut [u8]) -> std::io::Result<()> {
42 //! -1 => return Err(std::io::Error::last_os_error()),
52 //! - Error values are translated to [`Result`]s.
53 //! - Buffers are passed as Rust slices.
54 //! - Out-parameters are presented as return values.
55 //! - Path arguments use [`Arg`], so they accept any string type.
56 //! - File descriptors are passed and returned via [`AsFd`] and [`OwnedFd`]
57 //! instead of bare integers, ensuring I/O safety.
58 //! - Constants use `enum`s and [`bitflags`] types, and enable [support for
60 //! - Multiplexed functions (eg. `fcntl`, `ioctl`, etc.) are de-multiplexed.
61 //! - Variadic functions (eg. `openat`, etc.) are presented as non-variadic.
62 //! - Functions that return strings automatically allocate sufficient memory
64 //! - Functions and types which need `l` prefixes or `64` suffixes to enable
65 //! large-file support (LFS) are used automatically. File sizes and offsets
67 //! - Behaviors that depend on the sizes of C types like `long` are hidden.
68 //! - In some places, more human-friendly and less historical-accident names
71 //! - Provide y2038 compatibility, on platforms which support this.
72 //! - Correct selected platform bugs, such as behavioral differences when
76 //! - Detecting whether functions are supported at runtime, except in specific
78 //! - Hiding significant differences between platforms.
79 //! - Restricting ambient authorities.
80 //! - Imposing sandboxing features such as filesystem path or network address
83 //! See [`cap-std`], [`system-interface`], and [`io-streams`] for libraries
84 //! which do hide significant differences between platforms, and [`cap-std`]
87 //! [`cap-std`]: https://crates.io/crates/cap-std
88 //! [`system-interface`]: https://crates.io/crates/system-interface
89 //! [`io-streams`]: https://crates.io/crates/io-streams
92 //! [`AsFd`]: https://doc.rust-lang.org/stable/std/os/fd/trait.AsFd.html
93 //! [`OwnedFd`]: https://doc.rust-lang.org/stable/std/os/fd/struct.OwnedFd.html
94 //! [I/O-safe]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
95 //! [`Result`]: https://doc.rust-lang.org/stable/std/result/enum.Result.html
97 …upport for externally defined flags]: https://docs.rs/bitflags/*/bitflags/#externally-defined-flags
110 #![cfg_attr(feature = "rustc-dep-of-std", feature(ip))]
111 #![cfg_attr(feature = "rustc-dep-of-std", allow(internal_features))]
113 any(feature = "rustc-dep-of-std", core_intrinsics),
117 #![cfg_attr(not(feature = "all-apis"), allow(dead_code))]
124 // "all-apis".
126 any(target_os = "redox", target_os = "wasi", not(feature = "all-apis")),
130 #[cfg(all(feature = "alloc", not(feature = "rustc-dep-of-std")))]
160 // linux_raw: Weak symbols are used by the use-libc-auxv feature for
166 all(linux_raw, feature = "use-libc-auxv"),
185 // Re-export `AsSocket` etc. too, as users can't implement `AsFd` etc. on
201 #[cfg(feature = "fs")]
202 #[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
203 pub mod fs; module
227 #[cfg(any(feature = "fs", feature = "mount", feature = "net"))]
230 doc(cfg(any(feature = "fs", feature = "mount", feature = "net")))
285 // "runtime" is also a public API module, but it's only for libc-like users.
293 // Temporarily provide some mount functions for use in the fs module for
296 #[cfg(all(feature = "fs", not(feature = "mount")))]
299 // Declare "fs" as a non-public module if "fs" isn't enabled but we need it for
302 #[cfg(not(feature = "fs"))]
305 not(feature = "use-libc-auxv"),
306 not(feature = "use-explicitly-provided-auxv"),
315 #[cfg_attr(doc_cfg, doc(cfg(feature = "fs")))]
316 pub(crate) mod fs; module
318 // Similarly, declare `path` as a non-public module if needed.
320 #[cfg(not(any(feature = "fs", feature = "mount", feature = "net")))]
323 not(feature = "use-libc-auxv"),
324 not(feature = "use-explicitly-provided-auxv"),
358 feature = "fs",
365 not(feature = "use-libc-auxv"),
366 not(feature = "use-explicitly-provided-auxv"),
379 feature = "fs",
384 not(feature = "use-libc-auxv"),
385 not(feature = "use-explicitly-provided-auxv"),