about summary refs log tree commit diff
path: root/library/std/src/sys/wasi/stdio.rs
AgeCommit message (Collapse)AuthorLines
2022-10-10Consolidate AsFd instances for stdio types into `library/std/src/os/fd/owned.rs`Josh Triplett-49/+1
2022-10-09impl AsFd for io::{Stdin, Stdout, Stderr}, not the sys versionsJosh Triplett-3/+3
https://github.com/rust-lang/rust/pull/100892 implemented AsFd for the sys versions, rather than for the public types. Change the implementations to apply to the public types.
2022-10-03Add SAFETY comments for AsFd implementations on stdin/stdout/stderrJosh Triplett-0/+3
2022-10-03Add stability attributes.Dan Gohman-3/+6
2022-09-22Add `AsFd` implementations for stdio lock types on WASI.Dan Gohman-0/+21
This mirrors the implementations on Unix platforms, and also mirrors the existing `AsRawFd` impls. This is similar to #100892, but is for the `*Lock` types.
2022-08-22Add `AsFd` implementations for stdio types on WASI.Dan Gohman-1/+22
This mirrors the implementations on Unix platforms, and also mirrors the existing `AsRawFd` impls.
2022-01-28wasi: update to wasi 0.11.0Harald Hoyer-1/+1
To make use of `sock_accept()`, update the wasi crate to `0.11.0`. Signed-off-by: Harald Hoyer <harald@profian.com>
2021-08-19I/O safety.Dan Gohman-6/+13
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>
2021-08-13Change WASI's `RawFd` from `u32` to `c_int` (`i32`).Dan Gohman-3/+4
WASI previously used `u32` as its `RawFd` type, since its "file descriptors" are unsigned table indices, and there's no fundamental reason why WASI can't have more than 2^31 handles. However, this creates myriad little incompability problems with code that also supports Unix platforms, where `RawFd` is `c_int`. While WASI isn't a Unix, it often shares code with Unix, and this difference made such shared code inconvenient. #87329 is the most recent example of such code. So, switch WASI to use `c_int`, which is `i32`. This will mean that code intending to support WASI should ideally avoid assuming that negative file descriptors are invalid, even though POSIX itself says that file descriptors are never negative. This is a breaking change, but `RawFd` is considerd an experimental feature in [the documentation]. [the documentation]: https://doc.rust-lang.org/stable/std/os/wasi/io/type.RawFd.html
2021-02-24x.py fmtDan Gohman-1/+1
2021-02-24Use `super::` to refer to WASI-specific names.Dan Gohman-1/+1
This ensures that these names resolve to the right place even when building the WASI support on other platforms for generating the documentation.
2020-09-03Applied `#![deny(unsafe_op_in_unsafe_fn)]` in library/std/src/wasiAmjad Alsharafi-0/+2
All refactoring needed was only in `alloc.rs`, changed part of the code in `alloc` method to satisfy the SAFETY statement
2020-08-21Make raw standard stream constructors constTomasz Miąsko-3/+3
2020-08-21Remove result type from raw standard streams constructorsTomasz Miąsko-7/+7
Raw standard streams constructors are infallible. Remove unnecessary result type.
2020-07-27mv std libs to library/mark-0/+102