| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Use std::io::Error::is_interrupted everywhere
In https://github.com/rust-lang/rust/pull/115228 I introduced this helper and started using it, this PR uses it to replace all applicable uses of `std::io::Error::kind`. The justification is the same; for whatever reason LLVM totally flops optimizing `Error::kind` so it's nice to use it less.
FYI ``@mkroening`` I swear the hermit changes look good, but I was so sure about the previous PR.
|
|
|
|
fix(sys/hermit): add is_interrupted
https://github.com/rust-lang/rust/pull/115228 broke compilation for Hermit by not adding a Hermit implementation of is_interrupted.
|
|
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
This function does not exist as of hermit-sys 0.4.1 [1].
Once std does not call this function, we can remove it entirely.
[1]: https://github.com/hermitcore/hermit-rs/commit/e38f246e046c3ad50bd2f5e33d8d810d33891cbd#diff-a9b7fa816defab285f0d4fe69d4df4a0cbbcf1c89913000df3273aded949f257R10
Signed-off-by: Martin Kröning <martin.kroening@eonerc.rwth-aachen.de>
|
|
Use random `HashMap` keys on Hermit
Initializing the keys with random data provided by the libOS avoids HashDOS attacks and similar issues.
CC `@stlankes`
|
|
|
|
|
|
|
|
By moving the IO traits, the RustyHermit support is harmonized to
of other operating systems.
|
|
RustHermit publishs a new kernel interface and supports
a common BSD socket layer. By supporting this interface,
the implementation can be harmonized to other operating systems.
To realize this socket layer, the handling of file descriptors
is also harmonized to other operating systems.
|
|
This symbol should be provided by Hermit.
|
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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`.
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
`#![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.
|
|
|
|
|
|
This reverts commit 7cae9e8c88e468e94c157d9aaee4b8e3cf90b9a4.
|
|
|
|
- fix commit 7dc3886
- previous commit doesn't adjust all targets
|
|
|