about summary refs log tree commit diff
path: root/library/std/src/os
AgeCommit message (Collapse)AuthorLines
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-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-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
2023-01-14Fix the stability attributes for `std::os::fd`.Dan Gohman-3/+3
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
2023-01-14Remove various double spaces in source comments.André Vennberg-1/+1
2023-01-09Disable `linux_ext` in wasm32 and fortanix rustdoc builds.John Millikin-0/+9
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`.
2023-01-04relax reference requirement on from_abstract_namemllken-2/+2
2022-11-20enable fuzzy_provenance_casts lint in libstdRalf Jung-0/+1
2022-11-15Rollup merge of #103734 - Mark-Simulacrum:fix-version-stabilized, r=JohnTitorMatthias Krüger-2/+2
Adjust stabilization version to 1.65.0 for wasi fds See https://github.com/rust-lang/rust/pull/103308#issuecomment-1292277645 for this ask. Backport of that PR to beta (1.65.0) will include a similar patch.
2022-11-14Rollup merge of #101967 - jmillikin:linux-abstract-socket-addr, r=joshtriplettMatthias Krüger-95/+140
Move `unix_socket_abstract` feature API to `SocketAddrExt`. The pre-stabilized API for abstract socket addresses exposes methods on `SocketAddr` that are only enabled for `cfg(any(target_os = "android", target_os = "linux"))`. Per discussion in <https://github.com/rust-lang/rust/issues/85410>, moving these methods to an OS-specific extension trait is required before stabilization can be considered. This PR makes four changes: 1. The internal module `std::os::net` contains logic for the unstable feature `tcp_quickack` (https://github.com/rust-lang/rust/issues/96256). I moved that code into `linux_ext/tcp.rs` and tried to adjust the module tree so it could accommodate a second unstable feature there. 2. Moves the public API out of `impl SocketAddr`, into `impl SocketAddrExt for SocketAddr` (the headline change). 3. The existing function names and docs for `unix_socket_abstract` refer to addresses as being created from abstract namespaces, but a more accurate description is that they create sockets in *the* abstract namespace. I adjusted the function signatures correspondingly and tried to update the docs to be clearer. 4. I also tweaked `from_abstract_name` so it takes an `AsRef<[u8]>` instead of `&[u8]`, allowing `b""` literals to be passed directly. Issues: 1. The public module `std::os::linux::net` is marked as part of `tcp_quickack`. I couldn't figure out how to mark a module as being part of two unstable features, so I just left the existing attributes in place. My hope is that this will be fixed as a side-effect of stabilizing either feature.
2022-10-29Adjust stabilization version to 1.65.0 for wasi fdsMark Rousskov-2/+2
See https://github.com/rust-lang/rust/pull/103308#issuecomment-1292277645 for this ask.
2022-10-20Make the whole `std::os::wasi::io` module stable.Dan Gohman-1/+1
2022-10-20Mark `std::os::wasi::io::AsFd` etc. as stable.Dan Gohman-1/+1
io_safety was stabilized in Rust 1.63, so mark the io_safety exports in `std::os::wasi::io` as stable. Fixes #103306.
2022-10-15Add `IsTerminal` trait to determine if a descriptor or handle is a terminalJosh Triplett-0/+34
The UNIX and WASI implementations use `isatty`. The Windows implementation uses the same logic the `atty` crate uses, including the hack needed to detect msys terminals. Implement this trait for `File` and for `Stdin`/`Stdout`/`Stderr` and their locked counterparts on all platforms. On UNIX and WASI, implement it for `BorrowedFd`/`OwnedFd`. On Windows, implement it for `BorrowedHandle`/`OwnedHandle`. Based on https://github.com/rust-lang/rust/pull/91121 Co-authored-by: Matt Wilkinson <mattwilki17@gmail.com>
2022-10-10Consolidate AsFd instances for stdio types into `library/std/src/os/fd/owned.rs`Josh Triplett-0/+52
2022-09-30Standard library OS support for Apple WatchOSVladimir Michael Eatwell-0/+235
2022-09-29Rollup merge of #98368 - sunfishcode:sunfishcode/std-os-fd, r=joshtriplettYuki Okushi-46/+26
Make `std::os::fd` public. `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` r? `````@joshtriplett`````
2022-09-18Move `unix_socket_abstract` feature API to `SocketAddrExt`.John Millikin-83/+123
2022-09-18Adjust `tcp_quickack` feature to allow other `os::linux::net` features.John Millikin-12/+17
2022-09-12Rollup merge of #100767 - kadiwa4:escape_ascii, r=jackh726Dylan DPC-14/+2
Remove manual <[u8]>::escape_ascii `@rustbot` label: +C-cleanup
2022-09-04Don't duplicate file descriptors into stdio fdsbeetrees-1/+2
2022-09-02Fix compilation of the doc tests on Windows.Dan Gohman-0/+4
2022-08-29Re-introduce `unstable` attributes.Dan Gohman-2/+2
Add `#[unstable(feature = "os_fd", issue = "98699")]` to the new `pub use` declarations.
2022-08-29Clarify that the `fd` module is supported on Unix and WASI.Dan Gohman-3/+2
2022-08-29Make `std::os::fd` public.Dan Gohman-46/+23
`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-08-29Rollup merge of #96334 - devnexen:socket_mark, r=dtolnayMatthias Krüger-0/+50
socket `set_mark` addition. to be able to set a marker/id on the socket for network filtering (iptables/ipfw here) purpose.
2022-08-28Auto merge of #96324 - berendjan:set_tcp_quickack, r=dtolnaybors-0/+119
Add setter and getter for TCP_QUICKACK on TcpStream for Linux Reference issue #96256 Setting TCP_QUICKACK on TcpStream for Linux
2022-08-28Rollup merge of #100885 - mzohreva:mz/sgx-export-cancel-type, r=Mark-SimulacrumMatthias Krüger-1/+3
Export Cancel from std::os::fortanix_sgx::usercalls::raw This was missed in https://github.com/rust-lang/rust/pull/100642 cc ``@raoulstrackx`` and ``@jethrogb``
2022-08-23Rollup merge of #100835 - devnexen:listener_followups, r=devnexenDylan DPC-4/+2
net listen backlog update, follow-up from #97963. FreeBSD and using system limit instead for others.
2022-08-22Export Cancel from std::os::fortanix_sgx::usercalls::rawMohsen Zohrevandi-1/+3
This was missed in https://github.com/rust-lang/rust/pull/100642
2022-08-22net listen backlog update, follow-up from #97963.David CARLIER-4/+2
FreeBSD and using system limit instead for others.