about summary refs log tree commit diff
path: root/library/std/src/sys/windows/handle.rs
AgeCommit message (Collapse)AuthorLines
2024-01-11std: begin moving platform support modules into `pal`joboet-338/+0
2023-11-22unnecessary_castChris Denton-3/+3
casting to the same type is unnecessary
2023-11-22needless_borrowChris Denton-2/+2
this expression creates a reference which is immediately dereferenced by the compiler
2023-08-28Update windows ffi bindingsChris Denton-7/+2
2023-05-05Use new bindingsChris Denton-3/+3
2023-05-01Inline AsInner implementationsKonrad Borowski-0/+1
2023-03-06Implement read_buf for a few more typesTomasz Miąsko-0/+9
Implement read_buf for TcpStream, Stdin, StdinLock, ChildStdout, ChildStderr (and internally for AnonPipe, Handle, Socket), so that it skips buffer initialization. The other provided methods like read_to_string and read_to_end are implemented in terms of read_buf and so benefit from the optimization as well. This commit also implements read_vectored and is_read_vectored where applicable.
2022-08-18Address reviewer commentsNick Cameron-1/+1
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-08-05non-linux platformsNick Cameron-7/+5
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-07-06Tests for unsound Windows file methodsChris Denton-0/+3
2022-07-06Windows: Fallback for overlapped I/OChris Denton-0/+13
Try waiting on the file handle once. If that fails then give up.
2022-07-06Use `rtabort!` instead of `process::abort`Chris Denton-7/+2
2022-06-15Document that `BorrowedFd` may be used to do a `dup`.Dan Gohman-1/+1
2022-05-17Revert "Auto merge of #96441 - ChrisDenton:sync-pipes, r=m-ou-se"Mark Rousskov-5/+0
This reverts commit ddb7fbe8434be481607ae199fe2aee976ee2fc2e, reversing changes made to baaa3b682986879c7784b5733ecea942e9ae7de3.
2022-05-15fix use of SetHandleInformation on UWPbdbai-0/+1
2022-04-26Add `set_inheritable` for Windows `Handle`sChris Denton-0/+4
2022-04-05Use rtabortChris Denton-2/+1
2022-04-05Make `synchronous_write` safe to callChris Denton-16/+18
2022-04-05Complete reads and writes synchronously or abortChris Denton-66/+102
2022-03-03Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.Dan Gohman-6/+6
Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced as part of [I/O safety] in a few functions in the Windows FFI bindings. This factors out an `unsafe` block and two `unsafe` function calls in the Windows implementation code. And, it helps test `HandleOrNull` and `HandleOrInvalid`, which indeed turned up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's used inside of `HandleOrNull` and `HandleOrInvalid` which are also `#[repr(transparent)]`. [I/O safety]: https://github.com/rust-lang/rust/issues/87074
2022-01-25Rollup merge of #88794 - sunfishcode:sunfishcode/try-clone, r=joshtriplettMatthias Krüger-15/+6
Add a `try_clone()` function to `OwnedFd`. As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code. r? ``@joshtriplett``
2021-11-02more efficent File::read_buf impl for windows and unixDrMeepster-1/+34
2021-09-09Fix more Windows compilation errors.Dan Gohman-1/+5
2021-09-09Add a `try_clone()` function to `OwnedFd`.Dan Gohman-14/+1
As suggested in #88564. This adds a `try_clone()` to `OwnedFd` by refactoring the code out of the existing `File`/`Socket` code.
2021-08-19I/O safety.Dan Gohman-46/+76
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>
2020-07-27mv std libs to library/mark-0/+233