about summary refs log tree commit diff
path: root/library/std/src/sys/hermit
AgeCommit message (Collapse)AuthorLines
2021-09-28Rename `std::thread::available_onccurrency` to ↵Yoshua Wuyts-1/+1
`std::thread::available_parallelism`
2021-08-30add `TcpStream::set_linger` and `TcpStream::linger`ibraheemdev-0/+8
2021-08-13Don't put hermit mutexes in a box.Martin Kröning-1/+1
Hermit mutexes are movable.
2021-08-13Don't put hermit condvars in a box.Martin Kröning-1/+1
Hermit condvars are movable.
2021-08-13Don't put hermit rwlocks in a box.Martin Kröning-1/+1
Hermit rwlocks are movable.
2021-08-02Rollup merge of #86509 - CDirkx:os_str, r=m-ou-seYuki Okushi-1/+2
Move `os_str_bytes` to `sys::unix` Followup to #84967, with `OsStrExt` and `OsStringExt` moved out of `sys_common`, there is no reason anymore for `os_str_bytes` to live in `sys_common` and not in sys. This pr moves it to the location `sys::unix::os_str` and reuses the code on other platforms via `#[path]` (as is common in `sys`) instead of importing.
2021-07-05Make `getenv` return an Option instead of a ResultAris Merchant-7/+2
2021-07-03Move `os_str_bytes` to `sys::unix` and reuse it on other platforms.Christiaan Dirkx-1/+2
2021-07-02Auto merge of #85746 - m-ou-se:io-error-other, r=joshtriplettbors-29/+34
Redefine `ErrorKind::Other` and stop using it in std. This implements the idea I shared yesterday in the libs meeting when we were discussing how to handle adding new `ErrorKind`s to the standard library: This redefines `Other` to be for *user defined errors only*, and changes all uses of `Other` in the standard library to a `#[doc(hidden)]` and permanently `#[unstable]` `ErrorKind` that users can not match on. This ensures that adding `ErrorKind`s at a later point in time is not a breaking change, since the user couldn't match on these errors anyway. This way, we use the `#[non_exhaustive]` property of the enum in a more effective way. Open questions: - How do we check this change doesn't cause too much breakage? Will a crate run help and be enough? - How do we ensure we don't accidentally start using `Other` again in the standard library? We don't have a `pub(not crate)` or `#[deprecated(in this crate only)]`. cc https://github.com/rust-lang/rust/pull/79965 cc `@rust-lang/libs` `@ijackson` r? `@dtolnay`
2021-06-25Fix a few misspellings.Eric Huss-1/+1
2021-06-21Use `Unsupported` on platforms where `available_concurrency` is not implemented.Christiaan Dirkx-4/+2
2021-06-21Move `available_concurrency` implementation to `sys`Christiaan Dirkx-0/+8
2021-06-20Move `OsStringExt` and `OsStrExt` to `std::os`Christiaan Dirkx-3/+3
2021-06-15Rename ErrorKind::Unknown to Uncategorized.Mara Bos-28/+32
2021-06-15Fix copy-paste error in sys/hermit error message.Mara Bos-1/+1
2021-06-15Redefine `ErrorKind::Other` and stop using it in std.Mara Bos-27/+28
2021-06-01Multiple improvements to RwLocksBenoît du Garreau-0/+2
- Split `sys_common::RWLock` between `StaticRWLock` and `MovableRWLock` - Unbox `RwLock` on some platforms (Windows, Wasm and unsupported) - Simplify `RwLock::into_inner`
2021-05-21Auto merge of #85060 - ChrisDenton:win-file-exists, r=yaahcbors-1/+1
Windows implementation of feature `path_try_exists` Draft of a Windows implementation of `try_exists` (#83186). The first commit reorganizes the code so I would be interested to get some feedback on if this is a good idea or not. It moves the `Path::try_exists` function to `fs::exists`. leaving the former as a wrapper for the latter. This makes it easier to provide platform specific implementations and matches the `fs::metadata` function. The other commit implements a Windows specific variant of `exists`. I'm still figuring out my approach so this is very much a first draft. Eventually this will need some more eyes from knowledgable Windows people.
2021-05-19Move the implementation of `Path::exists` to `sys_common::fs` so platforms ↵Chris Denton-1/+1
can specialize it Windows implementation of `fs::try_exists`
2021-05-14Move `std::memchr` to `sys_common`Christiaan Dirkx-1/+1
2021-05-03Move `std::sys::hermit::ext` to `std::os::hermit`Christiaan Dirkx-53/+0
2021-04-30Auto merge of #84522 - CDirkx:cmath, r=yaahcbors-29/+1
Reuse `sys::unix::cmath` on other platforms Reuse `sys::unix::cmath` on all non-`windows` platforms. `unix` is chosen as the canonical location instead of `unsupported` or `common` because `unsupported` doesn't make sense semantically and `common` is reserved for code that is supported on all platforms. Also `unix` is already the home of some non-`windows` code that is technically not exclusive to `unix` like `unix::path`.
2021-04-28Reuse `unix::cmath`Christiaan Dirkx-29/+1
2021-04-27Rollup merge of #84521 - CDirkx:hermit-dedup, r=Mark-SimulacrumDylan DPC-92/+3
Reuse modules on `hermit` Reuse the following modules on `hermit`: - `unix::path` (contents identical) - `unsupported::io` (contents identical) - `unsupported::thread_local_key` (contents functionally identical, only changes are the panic error messages) `@rustbot` label: +T-libs-impl
2021-04-25Auto merge of #84115 - CDirkx:rt, r=m-ou-sebors-8/+10
Rework `init` and `cleanup` This PR reworks the code in `std` that runs before and after `main` and centralizes this code respectively in the functions `init` and `cleanup` in both `sys_common` and `sys`. This makes is easy to see what code is executed during initialization and cleanup on each platform just by looking at e.g. `sys::windows::init`. Full list of changes: - new module `rt` in `sys_common` to contain `init` and `cleanup` and the runtime macros. - `at_exit` and the mechanism to register exit handlers has been completely removed. In practice this was only used for closing sockets on windows and flushing stdout, which have been moved to `cleanup`. - <s>On windows `alloc` and `net` initialization is now done in `init`, this saves a runtime check in every allocation and network use.</s>
2021-04-24Reuse `unix::path` and `unsupported::{io, thread_local_key}` on `hermit`Christiaan Dirkx-92/+3
2021-04-23Explicitly implement `!Send` and `!Sync` for `sys::{Args, Env}`Christiaan Dirkx-6/+8
2021-04-22Rollup merge of #84413 - CDirkx:args_inner_debug, r=m-ou-seDylan DPC-3/+4
Remove `sys::args::Args::inner_debug` and use `Debug` instead This removes the method `sys::args::Args::inner_debug` on all platforms and implements `Debug` for `Args` instead. I believe this creates a more natural API for the different platforms under `sys`: export a type `Args: Debug + Iterator + ...` vs. `Args: Iterator + ...` and with a method `inner_debug`.
2021-04-22Document that `init` and `cleanup` are not guaranteed to runChristiaan Dirkx-0/+2
2021-04-22Move most init to `sys::init`Christiaan Dirkx-4/+2
2021-04-22Remove `sys::args::Args::inner_debug` and use `Debug` insteadChristiaan Dirkx-3/+4
2021-04-22Move all cleanup to `sys::cleanup`Christiaan Dirkx-4/+3
2021-04-22Rework `at_exit` to `cleanup`Christiaan Dirkx-2/+5
2021-04-20Change uses of never typeChristiaan Dirkx-29/+29
2021-04-20Replace `Void` with never typeChristiaan Dirkx-15/+10
2021-04-18Rename `NotSupported` to `Unsupported`Christiaan Dirkx-1/+1
2021-04-18Use `NotSupported` in more placesChristiaan Dirkx-44/+45
2021-03-24Rollup merge of #83353 - m-ou-se:io-error-avoid-alloc, r=nagisaDylan DPC-78/+95
Add internal io::Error::new_const to avoid allocations. This makes it possible to have a io::Error containing a message with zero allocations, and uses that everywhere to avoid the *three* allocations involved in `io::Error::new(kind, "message")`. The function signature isn't perfect, because it needs a reference to the `&str`. So for now, this is just a `pub(crate)` function. Later, we'll be able to use `fn new_const<MSG: &'static str>(kind: ErrorKind)` to make that a bit better. (Then we'll also be able to use some ZST trickery if that would result in more efficient code.) See https://github.com/rust-lang/rust/issues/83352
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-78/+95
2021-02-24Reuse `std::sys::unsupported::pipe` on `hermit`Christiaan Dirkx-38/+1
2021-01-13deprecate atomic::spin_loop_hint in favour of hint::spin_loopAshley Mannix-2/+3
2020-11-14Disambiguate symlink argument namesDavid Tolnay-2/+2
2020-11-07Rollup merge of #74979 - maekawatoshiki:fix, r=Mark-SimulacrumYuki Okushi-0/+2
`#![deny(unsafe_op_in_unsafe_fn)]` in sys/hermit Partial fix of #73904. This encloses ``unsafe`` operations in ``unsafe fn`` in ``sys/hermit``. Some unsafe blocks are not well documented because some system-based functions lack documents.
2020-10-13box mutex to get a movable mutexStefan Lankes-1/+1
the commit avoid an alignement issue in Mutex implementation
2020-10-12define required type 'MovableMutex'Stefan Lankes-0/+2
2020-10-12reuse implementation of the system provider "unsupported"Stefan Lankes-0/+1
2020-10-12remove obsolete function divergeStefan Lankes-153/+0
2020-10-11revise code to pass the format checkStefan Lankes-3/+3
2020-10-11fix typos in new methodStefan Lankes-1/+5
2020-10-11revise comments and descriptions of the helper functionsStefan Lankes-3/+2