about summary refs log tree commit diff
path: root/library/std/src/os/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-09-06Add socket extensions for cygwinBerrysoft-1/+1
2025-03-17Rollup merge of #137621 - Berrysoft:cygwin-std, r=joboetJacob Pratt-0/+2
Add std support to cygwin target
2025-03-10Apply rustc-0054-Add-std-os-fd-support-for-Trusty.patchNicole LeGare-1/+3
2025-03-10Initial STD support for Cygwin王宇逸-0/+2
Signed-off-by: Ookiineko <chiisaineko@protonmail.com>
2024-11-03Auto merge of #123723 - madsmtm:apple-std-os, r=dtolnaybors-3/+21
Make `std::os::darwin` public I'm not sure of the reasoning behind them not being public before, but I think they should be, just like `std::os::ios` and `std::os::macos` are public. Additionally, I've merged their source code, as it was otherwise just a bunch of unnecessary duplication. Ultimately, I've done this PR to fix `./x build library --target=aarch64-apple-tvos,aarch64-apple-watchos,aarch64-apple-visionos`, as that currently fails because of dead code warnings. Since you reviewed https://github.com/rust-lang/rust/pull/121419 r? davidtwco Fixes https://github.com/rust-lang/rust/issues/121640. `@rustbot` label O-tvos O-watchos O-visionos
2024-09-24Initial std library support for NuttXHuang Qi-0/+2
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-09-03Port std library to RTEMSJan Sommer-0/+2
2024-08-13Make `std::os::darwin` publicMads Marquart-3/+21
This includes `std::os::darwin::fs`, which is re-exported under `std::os::macos::fs` and `std::os::ios::fs`. `std::os::darwin::raw` is not exposed, which means that `MetadataExt::as_raw_stat` isn't available on tvOS, visionOS and watchOS.
2024-07-14std: deny(unsafe_op_in_unsafe_fn) but allow sitesJubilee Young-0/+1
This provides a list of locations to hunt down issues in.
2024-07-14Merge Apple `std::os` extensions modules into `std::os::darwin`Mads Marquart-8/+3
The functionality available on Apple platforms are very similar, and were duplicated for each platform. Additionally, this fixes a warning when compiling the standard library for tvOS, watchOS and visionOS by marking the corresponding code as dead code.
2024-06-12export std::os::fd module on HermitOSStefan Lankes-1/+1
The HermitOS' IO interface is similiar to Unix. Consequently, this PR synchronize the FD implementation between both.
2024-03-18Support for visionOSAdam Gastineau-0/+2
2024-02-27Rename wasm32-wasi-preview2 to wasm32-wasip2Ryan Levick-2/+2
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2024-02-27Add the wasm32-wasi-preview2 targetRyan Levick-0/+3
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2024-01-28Revert "Add the wasm32-wasi-preview2 target"León Orell Valerian Liehr-3/+0
This reverts commit 31ecf341250a889ac1154b2cbe3f0b97f9d008c1. Co-authored-by: Ryan Levick <me@ryanlevick.com>
2024-01-23Add the wasm32-wasi-preview2 targetRyan Levick-0/+3
Signed-off-by: Ryan Levick <me@ryanlevick.com>
2023-10-09Support AIX in Rust standard libraryQiu Chaofan-0/+2
2023-09-22Fixes from PRAyush Singh-1/+1
- Hide Docs - Use repr_unpacked error Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22Rebase to masterAyush Singh-1/+0
- Update Example - Add thread_parking to sys::uefi - Fix unsafe in unsafe errors - Improve docs - Improve os/exit - Some asserts - Switch back to atomics Signed-off-by: Ayush Singh <ayushdevel1325@gmail.com>
2023-09-22Add support for building `std::os::uefi` docsAyush Singh-0/+1
Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-22Add Minimal Std implementation for UEFIAyush Singh-0/+2
Implemented modules: 1. alloc 2. os_str 3. env 4. math Tracking Issue: https://github.com/rust-lang/rust/issues/100499 API Change Proposal: https://github.com/rust-lang/libs-team/issues/87 This was originally part of https://github.com/rust-lang/rust/pull/100316. Since that PR was becoming too unwieldy and cluttered, and with suggestion from @dvdhrm, I have extracted a minimal std implementation to this PR. Signed-off-by: Ayush Singh <ayushsingh1325@gmail.com>
2023-09-21added support for GNU/HurdSamuel Thibault-0/+2
2023-08-22std: xous: add os-specific ffi callsSean Cross-0/+2
Xous has no C FFI. Instead, all FFI is done via syscalls that are specified in Rust. Add these FFI calls to libstd, as well as some of the currently-supported syscalls. This enables Rust programs to interact with the Xous operating system while avoiding adding an extra dependency to libstd. Signed-off-by: Sean Cross <sean@xobs.io>
2023-06-21wip: Support Apple tvOS in libstdThom Chiovoloni-0/+3
2023-05-07PS Vita std supportNikolay Arhipov-0/+2
2023-03-02Auto merge of #106673 - flba-eb:add_qnx_nto_stdlib, r=workingjubileebors-0/+2
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-02-28Add QNX Neutrino support to libstdFlorian Bartels-0/+2
Co-authored-by: gh-tr <troach@qnx.com>
2023-02-24move IO traits to std/src/os/hermitStefan Lankes-10/+2
By moving the IO traits, the RustyHermit support is harmonized to of other operating systems.
2022-09-30Standard library OS support for Apple WatchOSVladimir Michael Eatwell-0/+2
2022-08-29Make `std::os::fd` public.Dan Gohman-1/+1
`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-13created tcpstream quickack traitBerend-Jan Lange-0/+3
for linux and android
2022-07-20Library changes for Apple WatchOSVladimir Michael Eatwell-1/+0
2022-06-13Horizon OS STD supportMeziu-0/+2
Co-authored-by: Ian Chamberlain <ian.h.chamberlain@gmail.com> Co-authored-by: Mark Drobnak <mark.drobnak@gmail.com>
2022-03-09put L4Re specifics into their own platformBenjamin Lamowski-1/+3
The initial stdlib modifications for L4Re just used the linux specifics directly because they were reasonably close to L4Re's behavior. However, this breaks when Linux-specific code relies on code that is only available for the linux target, such as in #81825. Put L4Re into its own platform to avoid such breakage in the future. This uses the Linux-specific code as a starting point, which seems to be in line with other OSes with a unix-y interface such as Fuchsia.
2021-09-28Add SOLID targetsTomoaki Kawada-0/+2
SOLID[1] is an embedded development platform provided by Kyoto Microcomputer Co., Ltd. This commit introduces a basic Tier 3 support for SOLID. # New Targets The following targets are added: - `aarch64-kmc-solid_asp3` - `armv7a-kmc-solid_asp3-eabi` - `armv7a-kmc-solid_asp3-eabihf` SOLID's target software system can be divided into two parts: an RTOS kernel, which is responsible for threading and synchronization, and Core Services, which provides filesystems, networking, and other things. The RTOS kernel is a μITRON4.0[2][3]-derived kernel based on the open-source TOPPERS RTOS kernels[4]. For uniprocessor systems (more precisely, systems where only one processor core is allocated for SOLID), this will be the TOPPERS/ASP3 kernel. As μITRON is traditionally only specified at the source-code level, the ABI is unique to each implementation, which is why `asp3` is included in the target names. More targets could be added later, as we support other base kernels (there are at least three at the point of writing) and are interested in supporting other processor architectures in the future. # C Compiler Although SOLID provides its own supported C/C++ build toolchain, GNU Arm Embedded Toolchain seems to work for the purpose of building Rust. # Unresolved Questions A μITRON4 kernel can support `Thread::unpark` natively, but it's not used by this commit's implementation because the underlying kernel feature is also used to implement `Condvar`, and it's unclear whether `std` should guarantee that parking tokens are not clobbered by other synchronization primitives. # Unsupported or Unimplemented Features Most features are implemented. The following features are not implemented due to the lack of native support: - `fs::File::{file_attr, truncate, duplicate, set_permissions}` - `fs::{symlink, link, canonicalize}` - Process creation - Command-line arguments Backtrace generation is not really a good fit for embedded targets, so it's intentionally left unimplemented. Unwinding is functional, however. ## Dynamic Linking Dynamic linking is not supported. The target platform supports dynamic linking, but enabling this in Rust causes several problems. - The linker invocation used to build the shared object of `std` is too long for the platform-provided linker to handle. - A linker script with specific requirements is required for the compiled shared object to be actually loadable. As such, we decided to disable dynamic linking for now. Regardless, the users can try to create shared objects by manually invoking the linker. ## Executable Building an executable is not supported as the notion of "executable files" isn't well-defined for these targets. [1] https://solid.kmckk.com/SOLID/ [2] http://ertl.jp/ITRON/SPEC/mitron4-e.html [3] https://en.wikipedia.org/wiki/ITRON_project [4] https://toppers.jp/
2021-09-13Move fortanix module position in std::os reexports for alpha sortGuillaume Gomez-20/+34
2021-09-13Remove usage of cfg_if in std/src/os/mod.rsGuillaume Gomez-31/+71
2021-09-13Simplify std::os module reexports to fix rustdoc linking issuesGuillaume Gomez-109/+74
2021-08-19Factor out a common `RawFd`/`AsRawFd`/etc for Unix and WASI.Dan Gohman-1/+1
2021-08-19Factor out Unix and WASI fd code into a common module.Dan Gohman-0/+3
2021-08-10STD support for the ESP-IDF frameworkivmarkov-0/+2
2021-05-03Allow documenting on `hermit`Christiaan Dirkx-2/+0
2021-05-03Rework `os` to avoid using `cfg_if!` with public itemsChristiaan Dirkx-87/+115
2021-05-03Move `std::sys::wasi::ext` to `std::os::wasi`Christiaan Dirkx-2/+1
2021-05-03Move `std::sys::unix::ext` to `std::os::unix`Christiaan Dirkx-4/+2
2021-05-03Move `std::sys::windows::ext` to `std::os::windows`Christiaan Dirkx-4/+2
2021-05-03Move `std::sys::hermit::ext` to `std::os::hermit`Christiaan Dirkx-1/+6
2021-05-03Cleanup `std::os`Christiaan Dirkx-74/+89
2021-03-03Rollup merge of #82712 - CDirkx:cfg-target_os, r=dtolnayYuki Okushi-1/+1
Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks` `redox` and `vxworks` are now part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `cfg(target_os="vxworks")` https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/redox_base.rs#L26 https://github.com/rust-lang/rust/blob/35dbef235048f9a2939dc20effe083ca483c37ff/compiler/rustc_target/src/spec/vxworks_base.rs#L27
2021-03-03Remove unnecessary conditional `cfg(target_os)` for `redox` and `vxworks`Christiaan Dirkx-1/+1
`redox` and `vxworks` are part of target_family `unix`, thus `cfg(unix)` already implies `cfg(target_os="redox")` and `(target_os="vxworks")`