about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
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-07Inline Windows `OsStrExt::encode_wide`Nikolai Vazquez-0/+1
User crates currently produce much more code than necessary because the optimizer fails to make assumptions about this method.
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-05-25Disable unix::net::ancillary on BSD.Mara Bos-155/+31
2022-05-17Revert "Auto merge of #96441 - ChrisDenton:sync-pipes, r=m-ou-se"Mark Rousskov-13/+0
This reverts commit ddb7fbe8434be481607ae199fe2aee976ee2fc2e, reversing changes made to baaa3b682986879c7784b5733ecea942e9ae7de3.
2022-05-15Rollup merge of #97060 - bdbai:fix/uwphandle, r=ChrisDentonDylan DPC-0/+2
Fix use of SetHandleInformation on UWP The use of `SetHandleInformation` (introduced in #96441 to make `HANDLE` inheritable) breaks UWP builds because it is not available for UWP targets. Proposed workaround: duplicate the `HANDLE` with `inherit = true` and immediately close the old one. Traditional Windows Desktop programs are not affected. cc `@ChrisDenton`
2022-05-15Rollup merge of #96947 - ↵Dylan DPC-0/+47
sunfishcode:sunfishcode/rustc-nonnull-optimization-guaranteed, r=joshtriplett Add rustc_nonnull_optimization_guaranteed to Owned/Borrowed Fd/Socket PR #94586 added support for using `rustc_nonnull_optimization_guaranteed` on values where the "null" value is the all-ones bitpattern. Now that #94586 has made it to the stage0 compiler, add `rustc_nonnull_optimization_guaranteed` to `OwnedFd`, `BorrowedFd`, `OwnedSocket`, and `BorrowedSocket`, since these types all exclude all-ones bitpatterns. This allows `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-05-15fix use of SetHandleInformation on UWPbdbai-0/+2
2022-05-11Fix comment syntax.Dan Gohman-0/+1
2022-05-11Relax the wording about the meaning of -1.Dan Gohman-6/+11
2022-05-11Fix attribute name.Dan Gohman-2/+2
2022-05-11RawSocket is unsigned on Windows.Dan Gohman-10/+9
2022-05-11Fix duplicate import on Windows.Dan Gohman-1/+1
2022-05-11Add rustc_nonnull_optimization_guaranteed to Owned/Borrowed Fd/SocketDan Gohman-0/+48
PR #94586 added support for using `rustc_nonnull_optimization_guaranteed` on values where the "null" value is the all-ones bitpattern. Now that #94586 has made it to the stage0 compiler, add `rustc_nonnull_optimization_guaranteed` to `OwnedFd`, `BorrowedFd`, `OwnedSocket`, and `BorrowedSocket`, since these types all exclude all-ones bitpatterns. This allows `Option<OwnedFd>`, `Option<BorrowedFd>`, `Option<OwnedSocket>`, and `Option<BorrowedSocket>` to be used in FFI declarations, as described in the [I/O safety RFC]. [I/O safety RFC]: https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md#ownedfd-and-borrowedfdfd-1
2022-05-11HandleOrNull can hold null, and HandleOrInvalid can hold INVALID_HANDLE_VALUE.Dan Gohman-9/+5
2022-05-10Fix incorrect mentions of `OwnedFd` and `BorrowedFd` in Windows docs.Dan Gohman-4/+4
2022-05-10Also document that `as_raw_handle` may return NULL.Dan Gohman-0/+7
2022-05-10Clarify what values `BorrowedHandle`, `OwnedHandle` etc. can hold.Dan Gohman-12/+17
Clarify that when `BorrowedHandle`, `OwnedHandle`, or `HandleOrNull` hold the value `-1`, it always means the current process handle, and not `INVALID_HANDLE_VALUE`.
2022-05-10Auto merge of #96232 - sunfishcode:sunfishcode/io-safety-const-fns, ↵bors-5/+5
r=joshtriplett Make `BorrowedFd::borrow_raw` a const fn. Making `BorrowedFd::borrow_raw` a const fn allows it to be used to create a constant `BorrowedFd<'static>` holding constants such as `AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn. For consistency, make similar changes to `BorrowedHandle::borrow_raw` and `BorrowedSocket::borrow_raw`. [`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html r? `@joshtriplett`
2022-05-11Rollup merge of #96861 - m-ou-se:std-use-prelude-2021, r=joshtriplettYuki Okushi-3/+0
Use Rust 2021 prelude in std itself.
2022-05-10Expose process main_thread_handle on Windowsunknown-0/+14
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-3/+0
2022-05-09Auto merge of #95960 - jhpratt:remove-rustc_deprecated, r=compiler-errorsbors-123/+123
Remove `#[rustc_deprecated]` This removes `#[rustc_deprecated]` and introduces diagnostics to help users to the right direction (that being `#[deprecated]`). All uses of `#[rustc_deprecated]` have been converted. CI is expected to fail initially; this requires #95958, which includes converting `stdarch`. I plan on following up in a short while (maybe a bootstrap cycle?) removing the diagnostics, as they're only intended to be short-term.
2022-05-06Use statx's 64-bit times on 32-bit linux-gnuJosh Stone-3/+18
2022-04-29Auto merge of #96441 - ChrisDenton:sync-pipes, r=m-ou-sebors-0/+12
Windows: Make stdin pipes synchronous Stdin pipes do not need to be used asynchronously within the standard library. This is a first step in making pipes mostly synchronous. r? `@m-ou-se`
2022-04-27Auto merge of #96195 - sunfishcode:sunfishcode/handle-or-error-type, ↵bors-8/+44
r=joshtriplett Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`. Define `NullHandleError` and `InvalidHandleError` types, that implement std::error::Error, and use them as the error types in `HandleOrNull` and `HandleOrInvalid`, This addresses [this concern](https://github.com/rust-lang/rust/issues/87074#issuecomment-1080031167). This is the same as #95387. r? `@joshtriplett`
2022-04-26Add `set_inheritable` for Windows `Handle`sChris Denton-0/+12
2022-04-24Auto merge of #94609 - esp-rs:esp-idf-stat-type-fixes, r=Mark-Simulacrumbors-12/+12
espidf: fix stat Marking as draft as currently dependant on [a libc fix](https://github.com/rust-lang/libc/pull/2708) and release.
2022-04-19Make `BorrowedFd::borrow_raw` a const fn.Dan Gohman-5/+5
Making `BorrowedFd::borrow_raw` a const fn allows it to be used to create a constant `BorrowedFd<'static>` holding constants such as `AT_FDCWD`. This will allow [`rustix::fs::cwd`] to become a const fn. For consistency, make similar changes to `BorrowedHandle::borrow_raw` and `BorrowedSocket::borrow_raw`. [`rustix::fs::cwd`]: https://docs.rs/rustix/latest/rustix/fs/fn.cwd.html
2022-04-19espidf: fix statScott Mabin-12/+12
* corect type usage with new type definitions in libc
2022-04-18Add a comment explaining the `(())` idiom for empty structs.Dan Gohman-0/+2
2022-04-18Split `NotHandle` into `NullHandleError` and `InvalidHandleError`.Dan Gohman-14/+31
Also, make the display messages more specific, and remove the `Copy` implementation.
2022-04-18Move the `Error` impl for `NotHandle` out of platform-independent code.Dan Gohman-0/+3
2022-04-18Fix an incorrect word in a comment.Dan Gohman-2/+2
2022-04-18Define a dedicated error type for `HandleOrNull` and `HandleOrInvalid`.Dan Gohman-6/+20
Define a `NotHandle` type, that implements `std::error::Error`, and use it as the error type in `HandleOrNull` and `HandleOrInvalid`.
2022-04-14Remove use of `#[rustc_deprecated]`Jacob Pratt-123/+123
2022-04-11Fix documentation for wasm32-unknown-unknownO01eg-4/+4
2022-04-05Rollup merge of #88025 - devnexen:netbsd_scm_creds, r=AmanieuDylan DPC-13/+92
ScmCredentials netbsd implementation.
2022-04-04Rollup merge of #92942 - Xaeroxe:raw_arg, r=dtolnayDylan DPC-1/+1
stabilize windows_process_extensions_raw_arg Stabilizes the feature tracked at https://github.com/rust-lang/rust/issues/92939
2022-04-04Bump windows CommandExt::raw_arg to 1.62David Tolnay-1/+1
2022-04-04ScmCredentials netbsd implementation.David Carlier-13/+92
2022-03-29fix unix typedefAria Beingessner-1/+1
2022-03-29Make some linux/unix APIs better conform to strict provenance.Alexis Beingessner-2/+2
This largely makes the stdlib conform to strict provenance on Ubuntu. Some hairier things have been left alone for now.
2022-03-29Make the stdlib largely conform to strict provenance.Aria Beingessner-1/+3
Some things like the unwinders and system APIs are not fully conformant, this only covers a lot of low-hanging fruit.