about summary refs log tree commit diff
path: root/library/std/src/os/unix/io
AgeCommit message (Collapse)AuthorLines
2025-03-06library: Use size_of from the prelude instead of importedThalia Archibald-1/+0
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2024-04-27io safety: update Unix explanationRalf Jung-10/+21
2023-09-22fix OS-specific I/O safety docs since the io_safety feature is stableRalf Jung-4/+7
2023-08-14mention /proc/self/fd with /proc/self/memRalf Jung-3/+3
2023-08-14wording; and explain some of the possible consequences of violating io-safetyRalf Jung-1/+1
2023-08-13add more explicit I/O safety documentationRalf Jung-1/+2
2022-08-29Make `std::os::fd` public.Dan Gohman-20/+5
`std::os::fd` defines types like `OwnedFd` and `RawFd` and is common between Unix and non-Unix platforms that share a basic file-descriptor concept. Rust currently uses this internally to simplify its own code, but it would be useful for external users in the same way, so make it public. This means that `OwnedFd` etc. will all appear in three places, for example on unix platforms: - `std::os::fd::OwnedFd` - `std::os::unix::io::OwnedFd` - `std::os::unix::prelude::OwnedFd`
2022-06-20Rollup merge of #97837 - sunfishcode:sunfishcode/proc-self-mem, r=m-ou-seDylan DPC-0/+19
Document Rust's stance on `/proc/self/mem` Add documentation to `std::os::unix::io` describing Rust's stance on `/proc/self/mem`, treating it as an external entity which is outside the scope of Rust's safety guarantees.
2022-06-15Document that `BorrowedFd` may be used to do a `dup`.Dan Gohman-9/+19
2022-06-14Implement stabilization of `#[feature(io_safety)]`.Dan Gohman-3/+2
Implement stabilization of [I/O safety], aka `#[feature(io_safety)]`. Fixes #87074. [I/O safety]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md
2022-06-08Fix trailing whitespace.Dan Gohman-1/+1
2022-06-08Reword the question in the section header too.Dan Gohman-2/+2
This adopts the wording suggested in https://github.com/rust-lang/rust/pull/97837#discussion_r892524129.
2022-06-08Update library/std/src/os/unix/io/mod.rsDan Gohman-3/+2
Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
2022-06-08Reword a question into a statement.Dan Gohman-2/+2
2022-06-07Update library/std/src/os/unix/io/mod.rsDan Gohman-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2022-06-07Update library/std/src/os/unix/io/mod.rsDan Gohman-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2022-06-07Update library/std/src/os/unix/io/mod.rsDan Gohman-1/+1
Co-authored-by: Sean Stangl <sean.stangl@gmail.com>
2022-06-07Update library/std/src/os/unix/io/mod.rsDan Gohman-1/+1
Co-authored-by: Sean Stangl <sean.stangl@gmail.com>
2022-06-07Document Rust's stance on `/proc/self/mem`Dan Gohman-0/+20
Add documentation to `std::os::unix::io` describing Rust's stance on `/proc/self/mem`, treating it as an external entity which is outside the scope of Rust's safety guarantees.
2022-01-09Compute most of Public/Exported access level in rustc_resolveLamb-0/+1
Mak DefId to AccessLevel map in resolve for export hir_id to accesslevel in resolve and applied in privacy using local def id removing tracing probes making function not recursive and adding comments Move most of Exported/Public res to rustc_resolve moving public/export res to resolve fix missing stability attributes in core, std and alloc move code to access_levels.rs return for some kinds instead of going through them Export correctness, macro changes, comments add comment for import binding add comment for import binding renmae to access level visitor, remove comments, move fn as closure, remove new_key fmt fix rebase fix rebase fmt fmt fix: move macro def to rustc_resolve fix: reachable AccessLevel for enum variants fmt fix: missing stability attributes for other architectures allow unreachable pub in rustfmt fix: missing impl access level + renaming export to reexport Missing impl access level was found thanks to a test in clippy
2021-08-19Factor out a common `RawFd`/`AsRawFd`/etc for Unix and WASI.Dan Gohman-242/+2
2021-08-19Don't encourage migration until io_safety is stablized.Dan Gohman-3/+4
2021-08-19Factor out Unix and WASI fd code into a common module.Dan Gohman-280/+2
2021-08-19Synchronize minor differences between Unix and WASI implementations.Dan Gohman-4/+5
2021-08-19Reword the description of dup2/dup3.Dan Gohman-1/+1
2021-08-19Add Safety comments to the `As*` for `Owned*` implementations.Dan Gohman-0/+3
2021-08-19Rename `OwnedFd`'s private field to match it's debug output.Dan Gohman-17/+17
2021-08-19Be more precise about `mmap` and undefined behavior.Dan Gohman-3/+3
`mmap` doesn't *always* cause undefined behavior; it depends on the details of how you use it.
2021-08-19Add a test to ensure that RawFd is the size we assume it is.Dan Gohman-0/+15
2021-08-19Update library/std/src/os/unix/io/fd.rsDan Gohman-1/+1
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
2021-08-19I/O safety.Dan Gohman-0/+580
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: - <https://github.com/rust-lang/rust/issues/87074> RFC: - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>