about summary refs log tree commit diff
path: root/library/std/src/sys/pal/zkvm/mod.rs
AgeCommit message (Collapse)AuthorLines
2025-09-19Fix unsupported std::sys::threadThalia Archibald-2/+0
Fixes building std for any platform with an unsupported thread abstraction. This includes {aarch64,armv7,x86_64}-unknown-trusty and riscv32im-risc0-zkvm-elf, which explicitly include the unsupported module, and platforms with no PAL. Bug fix for PR 145177 (std: move thread into sys).
2025-04-18Combine env consts into std::sys::env_constsThalia Archibald-1/+0
2025-04-12Move args into std::sysThalia Archibald-3/+1
2025-03-22std: move process implementations to `sys`joboet-2/+0
As per #117276, this moves the implementations of `Process` and friends out of the `pal` module and into the `sys` module, removing quite a lot of error-prone `#[path]` imports in the process (hah, get it ;-)). I've also made the `zircon` module a dedicated submodule of `pal::unix`, hopefully we can move some other definitions there as well (they are currently quite a lot of duplications in `sys`). Also, the `ensure_no_nuls` function on Windows now lives in `sys::pal::windows` – it's not specific to processes and shared by the argument implementation.
2025-03-09std: move stdio to `sys`joboet-1/+0
As per #117276, this moves the platform definitions of `Stdout` and friends into `sys`. This PR also unifies the UNIX and Hermit implementations and moves the `__rust_print_err` function needed by libunwind on SGX into the dedicated module for such helper functions.
2025-03-08Move fs into sysThalia Archibald-2/+0
2025-03-06library: Use size_of from the prelude instead of importedThalia Archibald-1/+1
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the prelude instead of importing or qualifying them. These functions were added to all preludes in Rust 1.80.
2025-02-07std: move `io` module out of `pal`joboet-2/+0
2025-02-02std: move network code into `sys`joboet-2/+0
As per #117276, this PR moves `sys_common::net` and the `sys::pal::net` into the newly created `sys::net` module. In order to support #135141, I've moved all the current network code into a separate `connection` module, future functions like `hostname` can live in separate modules. I'll probably do a follow-up PR and clean up some of the actual code, this is mostly just a reorganization.
2024-09-23std: implement the `random` featurejoboet-8/+0
Implements the ACP https://github.com/rust-lang/libs-team/issues/393.
2024-08-27std: move allocators to `sys`joboet-6/+3
2024-07-16zkvm: add `#[forbid(unsafe_op_in_unsafe_fn)]` in `stdlib`Erik Kaneda-0/+1
This also adds an additional `unsafe` block to address compiler errors.
2024-06-15std: refactor the TLS implementationjoboet-1/+0
As discovered by Mara in #110897, our TLS implementation is a total mess. In the past months, I have simplified the actual macros and their expansions, but the majority of the complexity comes from the platform-specific support code needed to create keys and register destructors. In keeping with #117276, I have therefore moved all of the `thread_local_key`/`thread_local_dtor` modules to the `thread_local` module in `sys` and merged them into a new structure, so that future porters of `std` can simply mix-and-match the existing code instead of having to copy the same (bad) implementation everywhere. The new structure should become obvious when looking at `sys/thread_local/mod.rs`. Unfortunately, the documentation changes associated with the refactoring have made this PR rather large. That said, this contains no functional changes except for two small ones: * the key-based destructor fallback now, by virtue of sharing the implementation used by macOS and others, stores its list in a `#[thread_local]` static instead of in the key, eliminating one indirection layer and drastically simplifying its code. * I've switched over ZKVM (tier 3) to use the same implementation as WebAssembly, as the implementation was just a way worse version of that Please let me know if I can make this easier to review! I know these large PRs aren't optimal, but I couldn't think of any good intermediate steps. @rustbot label +A-thread-locals
2024-05-02std: move thread parking to `sys::sync`joboet-3/+0
2024-04-12zkvm: remove cmathMarijan Petričević-2/+0
- Remove cmath from zkvm module since cmath was moved to sys and is shared by all platforms (see #120109)
2024-04-11Factor some common `io::Error` constantsBenoît du Garreau-4/+1
2024-03-12std: move `Once` implementations to `sys`joboet-2/+0
2024-02-20Delete architecture-specific memchr code in std::sysArthur Carcano-4/+0
Currently all architecture-specific memchr code is only used in `std::io`. Most of the actual `memchr` capacity exposed to the user through the slice API is instead implemented in core::slice::memchr. Hence this commit deletes memchr from std::sys[_common] and replace calls to it by calls to core::slice::memchr functions. This deletes (r)memchr from the list of symbols linked to libc.
2024-02-16std: move locks to `sys` on platforms without threadsjoboet-2/+0
2024-02-08std: move path into `sys`joboet-4/+0
2024-01-22zkvm: add partial std supportErik Kaneda-0/+93
Co-authored-by: Frank Laub <flaub@risc0.com> Co-authored-by: nils <nils@risc0.com> Co-authored-by: Victor Graf <victor@risczero.com> Co-authored-by: weikengchen <w.k@berkeley.edu>