about summary refs log tree commit diff
path: root/library/std/src/sys/hermit
AgeCommit message (Collapse)AuthorLines
2022-11-29hermit: Remove unused exportsMartin Kröning-3/+1
2022-11-29hermit: Fix fuzzy_provenance_castsMartin Kröning-1/+2
2022-11-06std: remove lock wrappers in `sys_common`joboet-3/+3
2022-10-13std: use `sync::Mutex` for internal staticsjoboet-52/+26
2022-10-03Reduce CString allocations in std as much as possibleAlex Saveau-9/+4
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-09-09std: use futex-based locks and thread parker on Hermitjoboet-452/+47
2022-09-08Rollup merge of #101423 - mkroening:hermit-warnings, r=sanxiynMichael Goulet-4/+0
Fix hermit warnings This fixes two `unused_imprt` and one `dead_code` warning for hermit.
2022-09-08Rollup merge of #101422 - mkroening:hermit-file-time, r=joshtriplettDylan DPC-0/+12
Hermit: Add File::set_time stub This is not supported on hermit yet. This change is required for compiling std.
2022-09-04Auto merge of #100576 - joboet:movable_const_remutex, r=Mark-Simulacrumbors-3/+0
Make `ReentrantMutex` movable and `const` As `MovableMutex` is now `const`, it can be used to simplify the implementation and interface of the internal reentrant mutex type. Consequently, the standard error stream does not need to be wrapped in `OnceLock` and `OnceLock::get_or_init_pin()` can be removed.
2022-09-05Hermit: Remove unused socklen_t (dead_code)Martin Kröning-2/+0
2022-09-05Hermit: Fix unused_importsMartin Kröning-2/+0
2022-09-05Hermit: Add File::set_time stubMartin Kröning-0/+12
This is not supported on hermit yet. This change is required for compiling std.
2022-09-03std: make `ReentrantMutex` movable and `const`; simplify `Stdout` initializationjoboet-3/+0
2022-08-28Support `#[unix_sigpipe = "inherit|sig_dfl|sig_ign"]` on `fn main()`Martin Nordholts-1/+1
This makes it possible to instruct libstd to never touch the signal handler for `SIGPIPE`, which makes programs pipeable by default (e.g. with `./your-program | head -n 1`) without `ErrorKind::BrokenPipe` errors.
2022-08-18Address reviewer commentsNick Cameron-1/+1
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-08-05non-linux platformsNick Cameron-3/+3
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2022-06-26Hermit: Make Mutex::init a no-opMartin Kröning-3/+1
2022-06-26Hermit: Fix initializing lazy locksMartin Kröning-6/+24
2022-06-08remove unneeded codeStefan Lankes-5/+0
2022-06-03Use Drop instead of destroy() for locks.Mara Bos-12/+7
2022-05-09Use Rust 2021 prelude in std itself.Mara Bos-2/+0
2022-04-16Use a single ReentrantMutex implementation on all platforms.Mara Bos-36/+0
2022-04-14library: Remove definitions and reexports of `strlen` from libstdVadim Petrochenkov-10/+0
2022-04-06Rename RWLock to RwLock in std::sys.Mara Bos-7/+7
2022-03-22Move std::sys::{mutex, condvar, rwlock} to std::sys::locks.Mara Bos-6/+12
2022-02-15remove compiler warningsStefan Lankes-1/+1
2022-02-13make Instant::{duration_since, elapsed, sub} saturating and remove workaroundsThe8472-8/+0
This removes all mutex/atomics based workarounds for non-monotonic clocks and makes the previously panicking methods saturating instead. Effectively this moves the monotonization from `Instant` construction to the comparisons. This has some observable effects, especially on platforms without monotonic clocks: * Incorrectly ordered Instant comparisons no longer panic. This may hide some programming errors until someone actually looks at the resulting `Duration` * `checked_duration_since` will now return `None` in more cases. Previously it only happened when one compared instants obtained in the wrong order or manually created ones. Now it also does on backslides. The upside is reduced complexity and lower overhead of `Instant::now`.
2022-02-04Hide Repr details from io::Error, and rework `io::Error::new_const`.Thom Chiovoloni-37/+36
2021-12-09Auto merge of #81156 - DrMeepster:read_buf, r=joshtriplettbors-2/+6
Implement most of RFC 2930, providing the ReadBuf abstraction This replaces the `Initializer` abstraction for permitting reading into uninitialized buffers, closing #42788. This leaves several APIs described in the RFC out of scope for the initial implementation: * read_buf_vectored * `ReadBufs` Closes #42788, by removing the relevant APIs.
2021-11-24Improving the readabilityStefan Lankes-1/+1
Co-authored-by: kennytm <kennytm@gmail.com>
2021-11-24If the thread does not get the lock in the short term, yield the CPUStefan Lankes-1/+10
Reduces the amount of wasted processor cycles
2021-11-02more efficent File::read_buf impl for windows and unixDrMeepster-2/+6
2021-10-29hermit: Implement Condvar::wait_timeoutMartin Kröning-2/+14
2021-10-16remove compiler warningsStefan Lankes-1/+1
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