about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
2023-06-16Remove `#[cfg(all())]` workarounds from `c_char`Alex Macleod-5/+0
2023-06-13Fix building the documentation on FreeBSD.MikaelUrankar-0/+1
It fixes the following error: error[E0412]: cannot find type `sockcred2` in module `libc` --> library/std/src/os/unix/net/ancillary.rs:211:29 | 211 | pub struct SocketCred(libc::sockcred2); | ^^^^^^^^^ not found in `libc`
2023-06-06Fix documentation build on FreeBSDDan McGregor-1/+7
After the socket ancillary data implementation was introduced, the build was broken on FreeBSD, add the same workaround as for the existing implementations.
2023-06-05Std support improvement for ps vita targetNikolay Arhipov-1/+1
2023-05-30add doc on From<OwnedFd/Handle> impl for ChildStd*Vincent Thiberville-0/+24
2023-05-30add FromOwnedFd/FromOwnedHandle for ChildStdin/out/errVincent Thiberville-0/+57
2023-05-30Swap out CURRENT_RUSTC_VERSION to 1.71.0Mark Rousskov-6/+6
2023-05-15Add creation time support to `FileTimes` on apple and windowsbeetrees-7/+78
2023-05-14Auto merge of #108196 - sunfishcode:sunfishcode/windows-as-socket-impls, ↵bors-0/+72
r=dtolnay Implement `AsHandle`/`AsSocket` for `Arc`/`Rc`/`Box` on Windows Implement the Windows counterpart to #97437 and #107317: Implement `AsHandle` and `AsSocket` for `Arc<T>`, `Rc<T>`, and `Box<T>`.
2023-05-09Don't force include Windows goop when documentingChris Denton-34/+40
2023-05-09Auto merge of #110152 - ChrisDenton:windows-sys, r=thomccbors-1/+1
Start using `windows sys` for Windows FFI bindings in std Switch to using windows-sys for FFI. In order to avoid some currently contentious issues, this uses windows-bindgen to generate a smaller set of bindings instead of using the full crate. Unlike the windows-sys crate, the generated bindings uses `*mut c_void` for handle types instead of `isize`. This to sidestep opsem concerns about mixing pointer types and integers between languages. Note that `SOCKET` remains defined as an integer but instead of being a usize, it's changed to fit the [standard library definition](https://github.com/rust-lang/rust/blob/a41fc00eaf352541008965fec0dee811e44373b3/library/std/src/os/windows/raw.rs#L12-L16): ```rust #[cfg(target_pointer_width = "32")] pub type SOCKET = u32; #[cfg(target_pointer_width = "64")] pub type SOCKET = u64; ``` The generated bindings also customizes the `#[link]` imports. I hope to switch to using raw-dylib but I don't want to tie that too closely with the switch to windows-sys. --- Changes outside of the bindings are, for the most part, fairly minimal (e.g. some differences in `*mut` vs. `*const` or a few types differ). One issue is that our own bindings sometimes mix in higher level types, like `BorrowedHandle`. This is pretty adhoc though.
2023-05-08Rollup merge of #110638 - nikarh:vita, r=Mark-SimulacrumYuki Okushi-0/+175
STD support for PSVita This PR adds std support for `armv7-sony-vita-newlibeabihf` target. The work here is fairly similar to #95897, just for a different target platform. This depends on the following pull requests: rust-lang/backtrace-rs#523 rust-lang/libc#3209
2023-05-08Auto merge of #106621 - ozkanonur:enable-elided-lifetimes-for-doctests, ↵bors-1/+1
r=Mark-Simulacrum enable `rust_2018_idioms` lint group for doctests With this change, `rust_2018_idioms` lint group will be enabled for compiler/libstd doctests. Resolves #106086 Resolves #99144 Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-07PS Vita std supportNikolay Arhipov-0/+175
2023-05-07enable `rust_2018_idioms` for doctestsozkanonur-1/+1
Signed-off-by: ozkanonur <work@onurozkan.dev>
2023-05-05Use new bindingsChris Denton-1/+1
2023-05-01Inline AsRawFd implementationsKonrad Borowski-0/+1
2023-05-01Inline AsInner implementationsKonrad Borowski-0/+1
2023-04-28replace version placeholdersPietro Albini-17/+17
2023-04-27Auto merge of #110562 - ComputerDruid:riscv, r=tmandrybors-0/+6
Add definitions for riscv64gc-unknown-fuchsia To compile, also requires a libc update with https://github.com/rust-lang/libc/pull/3204
2023-04-26Spelling library/Josh Soref-2/+2
* advance * aligned * borrowed * calculate * debugable * debuggable * declarations * desugaring * documentation * enclave * ignorable * initialized * iterator * kaboom * monomorphization * nonexistent * optimizer * panicking * process * reentrant * rustonomicon * the * uninitialized Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-25Add definitions for riscv64gc-unknown-fuchsiaDan Johnson-0/+6
2023-04-13Rollup merge of #110072 - joshtriplett:stabilize-is-terminal, r=Mark-SimulacrumMatthias Krüger-2/+2
Stabilize IsTerminal FCP completed in https://github.com/rust-lang/rust/issues/98070 . closes: https://github.com/rust-lang/rust/issues/98070
2023-04-11Rollup merge of #96971 - zhaixiaojuan:master, r=wesleywiserMichael Goulet-0/+1
Initial support for loongarch64-unknown-linux-gnu Hi, We hope to add a new port in rust for LoongArch. LoongArch intro LoongArch is a RISC style ISA which is independently designed by Loongson Technology in China. It is divided into two versions, the 32-bit version (LA32) and the 64-bit version (LA64). LA64 applications have application-level backward binary compatibility with LA32 applications. LoongArch is composed of a basic part (Loongson Base) and an expanded part. The expansion part includes Loongson Binary Translation (LBT), Loongson VirtualiZation (LVZ), Loongson SIMD EXtension (LSX) and Loongson Advanced SIMD EXtension(LASX). Currently the LA464 processor core supports LoongArch ISA and the Loongson 3A5000 processor integrates 4 64-bit LA464 cores. LA464 is a four-issue 64-bit high-performance processor core. It can be used as a single core for high-end embedded and desktop applications, or as a basic processor core to form an on-chip multi-core system for server and high-performance machine applications. Documentations: ISA: https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html ABI: https://loongson.github.io/LoongArch-Documentation/LoongArch-ELF-ABI-EN.html More docs can be found at: https://loongson.github.io/LoongArch-Documentation/README-EN.html Since last year, we have locally adapted two versions of rust, rust1.41 and rust1.57, and completed the test locally. I'm not sure if I'm submitting all the patches at once, so I split up the patches and here's one of the commits
2023-04-10Stabilize IsTerminalJosh Triplett-2/+2
closes: https://github.com/rust-lang/rust/issues/98070
2023-04-04library/std: Add support for loongarch64zhaixiaojuan-0/+1
2023-04-02Fix typo in std/src/os/fd/owned.rsTaiki Endo-1/+1
2023-03-27socket ancillary data implementation for FreeBSD (from 13 and above).David CARLIER-21/+194
introducing new build config as well.
2023-03-18Stabilise `unix_socket_abstract`John Millikin-20/+15
Fixes https://github.com/rust-lang/rust/issues/85410
2023-03-15Bump version placeholdersMark Rousskov-2/+2
2023-03-04Auto merge of #89518 - a1phyr:unix_file_vectored_at, r=workingjubileebors-0/+87
Add vectored positioned I/O on Unix Add methods for vectored I/O with an offset on `File` for `unix` under `#![feature(unix_file_vectored_at)]`. The new methods are wrappers around `preadv` and `pwritev`. Tracking issue: #89517
2023-03-02Make std tests pass on newer AndroidPeter Collingbourne-0/+18
Newer versions of Android forbid the creation of hardlinks as well as Unix domain sockets in the /data filesystem via SELinux rules, which causes several tests depending on this behavior to fail. So let's skip these tests on Android with an #[ignore] directive.
2023-03-02Add basic testsBenoît du Garreau-0/+61
2023-03-02Take shared references as parameterBenoît du Garreau-12/+4
2023-03-02Auto merge of #106673 - flba-eb:add_qnx_nto_stdlib, r=workingjubileebors-13/+166
Add support for QNX Neutrino to standard library This change: - adds standard library support for QNX Neutrino (7.1). - upgrades `libc` to version `0.2.139` which supports QNX Neutrino `@gh-tr` ⚠️ Backtraces on QNX require https://github.com/rust-lang/backtrace-rs/pull/507 which is not yet merged! (But everything else works without these changes) ⚠️ Tested mainly with a x86_64 virtual machine (see qnx-nto.md) and partially with an aarch64 hardware (some tests fail due to constrained resources).
2023-03-01Update library/std/src/os/nto/mod.rsFlorian Bartels-1/+1
Co-authored-by: Jubilee <46493976+workingjubilee@users.noreply.github.com>
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-13/+166
Co-authored-by: gh-tr <troach@qnx.com>
2023-02-27Add vectored positioned I/O on UnixBenoît du Garreau-0/+34
2023-02-24avoid the usage of libc during the creation of documentationStefan Lankes-9/+7
2023-02-24remove code duplicationsStefan Lankes-392/+73
2023-02-24move IO traits to std/src/os/hermitStefan Lankes-16/+400
By moving the IO traits, the RustyHermit support is harmonized to of other operating systems.
2023-02-24add support of RustyHermit's BSD socket layerStefan Lankes-0/+6
RustHermit publishs a new kernel interface and supports a common BSD socket layer. By supporting this interface, the implementation can be harmonized to other operating systems. To realize this socket layer, the handling of file descriptors is also harmonized to other operating systems.
2023-02-17Implement `AsHandle`/`AsSocket` for `Arc`/`Rc`/`Box` on WindowsDan Gohman-0/+72
Implement the Windows counterpart to #97437 and #107317: Implement `AsHandle` and `AsSocket` for `Arc<T>`, `Rc<T>`, and `Box<T>`.
2023-02-08Rollup merge of #107317 - ids1024:asfd-rc, r=dtolnayMichael Goulet-0/+16
Implement `AsFd` and `AsRawFd` for `Rc` Fixes https://github.com/rust-lang/rust/issues/105931.
2023-01-30Auto merge of #107080 - Urgau:cleanup-bootstrap-extra-check-cfgs, ↵bors-8/+1
r=Mark-Simulacrum bootstrap: cleanup the list of extra check cfgs This PR performs some cleanups on the `EXTRA_CHECK_CFGS` list in bootstrap. - `target_os=watchos`: no longer relevant because there are now proper targets `*-apple-watchos` - `target_arch=nvptx64`: target `nvptx64-nvidia-cuda` makes it useless - `target_arch=le32`: target was removed (https://github.com/rust-lang/rust/pull/45041) - `release`: was removed from rustfmt (https://github.com/rust-lang/rustfmt/pull/5375 and https://github.com/rust-lang/rustfmt/pull/5449) - `dont_compile_me`: was removed from stdarch (https://github.com/rust-lang/stdarch/pull/1308) Also made some external cfg exception mode clear and only activated for rustc and rustc tools (as to not have the Standard Library unintentionally depend on them).
2023-01-29Rollup merge of #106618 - jmillikin:os-net-rustdoc-wasm32, r=JohnTitorMatthias Krüger-0/+9
Disable `linux_ext` in wasm32 and fortanix rustdoc builds. The `std::os::unix` module is stubbed out when building docs for these target platforms. The introduction of Linux-specific extension traits caused `std::os::net` to depend on sub-modules of `std::os::unix`, which broke rustdoc for the `wasm32-unknown-unknown` target. Adding an additional `#[cfg]` guard solves that rustdoc failure by not declaring `linux_ext` on targets with a stubbed `std::os::unix`. Fixes #105467
2023-01-26Implement `AsFd` and `AsRawFd` for `Rc`Ian Douglas Scott-0/+16
Fixes https://github.com/rust-lang/rust/issues/105931.
2023-01-25Remove outdated cfg on `le32`Urgau-8/+1
See https://github.com/rust-lang/rust/pull/45041 for the removal of the target (le32-unknown-nacl).
2023-01-18Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplettDylan DPC-2/+2
relax reference requirement on SocketAddrExt::from_abstract_name Reference: https://github.com/rust-lang/rust/issues/85410#issuecomment-1369544671
2023-01-15Rollup merge of #106867 - sunfishcode:sunfishcode/std-os-fd-stable-version, ↵Matthias Krüger-3/+3
r=m-ou-se Fix the stability attributes for `std::os::fd`. As `@bjorn3` pointed out [here], I used the wrong stability attribute in #98368 when making `std::os::fd` public. I set it to Rust 1.63, which was when io-safety was stabilized, but it should be Rust 1.66, which was when `std::os::fd` was stabilized. [here]: https://github.com/rust-lang/rust/pull/98368#discussion_r1063721420