about summary refs log tree commit diff
path: root/library/std/src/sys/pal/teeos
AgeCommit message (Collapse)AuthorLines
2024-12-06Rollup merge of #130254 - GrigorenkoPV:QuotaExceeded, r=dtolnayMatthias Krüger-1/+1
Stabilize `std::io::ErrorKind::QuotaExceeded` Also drop "Filesystem" from its name. See #130190 for more info. FCP in #130190 cc #86442 r? `@dtolnay`
2024-10-28std: refactor `pthread`-based synchronizationjoboet-0/+8
The non-trivial code for `pthread_condvar` is duplicated across the thread parking and the `Mutex`/`Condvar` implementations. This PR moves that code into `sys::pal`, which now exposes a non-movable wrapper type for `pthread_mutex_t` and `pthread_condvar_t`.
2024-10-05Stabilize `std::io::ErrorKind::QuotaExceeded`Pavel Grigorenko-1/+1
Also drop "Filesystem" from its name
2024-09-23std: implement the `random` featurejoboet-24/+0
Implements the ACP https://github.com/rust-lang/libs-team/issues/393.
2024-08-27std: move allocators to `sys`joboet-58/+0
2024-07-29Reformat `use` declarations.Nicholas Nethercote-9/+5
The previous commit updated `rustfmt.toml` appropriately. This commit is the outcome of running `x fmt --all` with the new formatting options.
2024-07-24Rollup merge of #127733 - GrigorenkoPV:don't-forget, r=AmanieuMatthias Krüger-11/+5
Replace some `mem::forget`'s with `ManuallyDrop` > but I would like to see a larger effort to replace all uses of `mem::forget`. _Originally posted by `@saethlin` in https://github.com/rust-lang/rust/issues/127584#issuecomment-2226087767_ So, r? `@saethlin` Sorry, I have finished writing all of this before I got your response.
2024-07-16deny unsafe_op_in_unsafe_fn for teeos袁浩----天命剑主-0/+1
2024-07-16clean unsafe op in unsafe fn袁浩----天命剑主-13/+15
2024-07-16clean unsafe op in unsafe fn袁浩----天命剑主-9/+9
2024-07-16delete #![allow(unsafe_op_in_unsafe_fn)]袁浩----天命剑主-1/+0
this is redundant, so we can just delete it.
2024-07-15lib: replace some `mem::forget`'s with `ManuallyDrop`Pavel Grigorenko-11/+5
2024-06-15std: refactor the TLS implementationjoboet-7/+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-29Make `std::env::{set_var, remove_var}` unsafe in edition 2024Tobias Bucher-2/+2
Allow calling these functions without `unsafe` blocks in editions up until 2021, but don't trigger the `unused_unsafe` lint for `unsafe` blocks containing these functions. Fixes #27970. Fixes #90308. CC #124866.
2024-05-02std: move thread parking to `sys::sync`joboet-2/+0
2024-04-11Factor some common `io::Error` constantsBenoît du Garreau-4/+1
2024-04-05Revert #121666Chris Denton-5/+1
This reverts #121666 due to #123495
2024-03-31std: move `thread::current` TLS variable out of `thread_info`joboet-12/+0
2024-03-12std: move `Once` implementations to `sys`joboet-2/+0
2024-03-02Rollup merge of #121666 - ChrisDenton:thread-name, r=cuviperMatthias Krüger-1/+5
Use the OS thread name by default if `THREAD_INFO` has not been initialized Currently if `THREAD_INFO` hasn't been initialized then the name will be set to `None`. This PR changes it to use the OS thread name by default. This mostly affects foreign threads at the moment but we could expand this to make more use of the OS thread name in the future. Note: I've only implemented `Thread::get_name` for windows, linux and macos (and macos adjacent) targets. The rest just return `None`.
2024-03-01Add `get_name` placeholder to other targetsChris Denton-1/+5
2024-02-20Delete architecture-specific memchr code in std::sysArthur Carcano-2/+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 teeosjoboet-153/+0
2024-02-15Use generic `NonZero` internally.Markus Reiter-2/+2
2024-02-08std: move path into `sys`joboet-2/+0
2024-02-05Remove unused structr0cky-3/+0
2024-01-22std: move cmath into `sys`joboet-2/+0
2024-01-15std: move OS String implementation into `sys`joboet-2/+0
2024-01-11std: begin moving platform support modules into `pal`joboet-0/+1159