about summary refs log tree commit diff
path: root/src/libstd/sys/hermit
AgeCommit message (Collapse)AuthorLines
2020-05-06Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppeDylan DPC-7/+6
use new interface to create threads on HermitCore - the new interface allows to define the stack size - increase the default stack size to 1 MByte
2020-04-27use nicer code style to define DEFAULT_MIN_STACK_SIZEStefan Lankes-1/+1
2020-04-26use new interface to create threads on HermitCoreStefan Lankes-7/+6
- the new interface allows to define the stack size
2020-04-26Update nameSteven Fackler-9/+9
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+43
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2020-04-08Rollup merge of #70134 - hermitcore:osstrext, r=dtolnayDylan DPC-0/+53
add basic support of OsStrExt for HermitCore - this patch increases the compatibility to other operating systems - in principle `ffi.rs` is derived from `src/libstd/sys/unix/ext/ffi.rs`
2020-04-06Rollup merge of #70808 - hermitcore:tls, r=dtolnayMazdak Farrokhzad-44/+48
Simplify dtor registration for HermitCore by using a list of destructors The implementation is similar to the macOS version and doesn't depend on additional OS support
2020-04-06Rollup merge of #70553 - hermitcore:abi, r=dtolnayMazdak Farrokhzad-33/+3
move OS constants to platform crate to reduce platform specific constants move O_RDONLY etc. and the definition of thread priorities to hermit-abi
2020-04-05Simplify dtor registration for HermitCore by using a list of destructorsStefan Lankes-44/+48
The implementation is similiar to macOS solution doesn't depend on additional OS support
2020-04-05Stop importing integer modules in libstdLinus Färnstrand-1/+0
2020-04-04Merge branch 'master' into abiStefan Lankes-87/+156
2020-04-04Auto merge of #70136 - hermitcore:network_tcp, r=dtolnaybors-87/+156
add basic IP support in HermitCore - add initial version to support sockets - use TcpStream as test case - HermitCore uses smoltcp as IP stack for pure Rust applications - further functionalities (e.g. UDP support) will be added step by step - in principle, the current PR is a revision of #69404
2020-04-04Merge branch 'master' into abiStefan Lankes-16/+9
2020-04-03Delete unnecessary stub stack overflow handler for hermit.Vytautas Astrauskas-12/+0
2020-04-02Remove unnecessary intermediate pointer cast in Thread::new.Vytautas Astrauskas-1/+1
2020-04-01In Thread::new, add a comment that a panic could cause a memory leak.Vytautas Astrauskas-1/+1
2020-03-31Use Box::into_raw instead of ManuallyDrop in Thread::new.Vytautas Astrauskas-4/+4
2020-03-31Inline start_thread into its callers.Vytautas Astrauskas-3/+6
2020-03-31Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new.Vytautas Astrauskas-6/+8
2020-03-30move the definition of thread priorities to hermit-abiStefan Lankes-24/+1
2020-03-30reorder imports to pass the format checkStefan Lankes-1/+1
2020-03-30minor changes to pass the format checkStefan Lankes-2/+1
2020-03-30move OS constants to platform crateStefan Lankes-8/+2
2020-03-21Rollup merge of #69955 - alexcrichton:stderr-infallible, r=sfacklerDylan DPC-3/+3
Fix abort-on-eprintln during process shutdown This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-20Fix abort-on-eprintln during process shutdownAlex Crichton-3/+3
This commit fixes an issue where if `eprintln!` is used in a TLS destructor it can accidentally cause the process to abort. TLS destructors are executed after `main` returns on the main thread, and at this point we've also deinitialized global `Lazy` values like those which store the `Stderr` and `Stdout` internals. This means that despite handling TLS not being accessible in `eprintln!`, we will fail due to not being able to call `stderr()`. This means that we'll double-panic quickly because panicking also attempt to write to stderr. The fix here is to reimplement the global stderr handle to avoid the need for destruction. This avoids the need for `Lazy` as well as the hidden panic inside of the `stderr` function. Overall this should improve the robustness of printing errors and/or panics in weird situations, since the `stderr` accessor should be infallible in more situations.
2020-03-19add basic IP support in HermitCoreStefan Lankes-87/+156
- add initial version to support sockets - use TcpStream as test case - HermitCore uses smoltcp as IP stack for pure Rust applications - further functionalities (e.g. UDP support) will be added step by step
2020-03-19add basic support of OsStrExt for HermitCoreStefan Lankes-0/+53
this patch increases the compatibility to other operating systems
2020-02-23Implement `Copy` for `IoSlice`LeSeulArtichaut-0/+1
2020-01-10make use of pointer::is_nullLzu Tao-5/+8
2019-12-24Deprecate Error::description for realDavid Tolnay-0/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-21Require issue = "none" over issue = "0" in unstable attributesRoss MacArthur-2/+2
2019-11-29Format libstd/sys with rustfmtDavid Tolnay-220/+211
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/sys *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/sys -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/sys outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-11-13protect creation of destructors by a mutexStefan Lankes-0/+3
add on HermizCore an additional lock to protect static data
2019-10-20move interface to the unikernel in the crate hermit-abiStefan Lankes-113/+54
=> simplifies the maintenance of the interface
2019-10-06minor changes to follow the Rust's style guidelinesStefan Lankes-5/+10
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-0/+2297
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker