summary refs log tree commit diff
path: root/src/libstd/sys/redox
AgeCommit message (Collapse)AuthorLines
2018-04-24Rollup merge of #49829 - ecstatic-morse:os-docs, r=steveklabnikkennytm-19/+43
Add doc links to `std::os` extension traits Addresses a small subset of #29367. This adds documentation links to the original type for various OS-specific extension traits, and uses a common sentence for introducing such traits (which now consistently ends in a period).
2018-04-14Prefer unprefixed paths for well known structsDylan MacKenzie-7/+7
2018-04-14Add doc links to `std::os` extension traitsDylan MacKenzie-19/+43
Add documentation links to the original type for various OS-specific extension traits and normalize the language for introducing such traits. Also, remove some outdated comments around the extension trait definitions.
2018-04-13std: Minimize size of panicking on wasmAlex Crichton-0/+4
This commit applies a few code size optimizations for the wasm target to the standard library, namely around panics. We notably know that in most configurations it's impossible for us to print anything in wasm32-unknown-unknown so we can skip larger portions of panicking that are otherwise simply informative. This allows us to get quite a nice size reduction. Finally we can also tweak where the allocation happens for the `Box<Any>` that we panic with. By only allocating once unwinding starts we can reduce the size of a panicking wasm module from 44k to 350 bytes.
2018-04-12Import the `alloc` crate as `alloc_crate` in stdSimon Sapin-1/+1
… to make the name `alloc` available.
2018-04-12Move Utf8Lossy decoder to libcoreSimon Sapin-1/+1
2018-04-04Auto merge of #48575 - ishitatsuyuki:unix-no-thread, r=alexcrichtonbors-0/+1
rustc_driver: get rid of the extra thread **Do not rollup** We can alter the stack size afterwards on Unix. Having a separate thread causes poor debugging experience when interrupting with signals. I have to get the backtrace of the all thread, as the main thread is waiting to join doing nothing else. This patch allows me to just run `bt` to get the desired backtrace.
2018-03-28Auto merge of #49460 - kennytm:rollup, r=kennytmbors-0/+5
Rollup of 12 pull requests - Successful merges: #49243, #49329, #49364, #49400, #49405, #49427, #49428, #49429, #49439, #49442, #49444, #49452 - Failed merges:
2018-03-28Remove hidden `foo` functions from doc examples; use `Termination` trait.Corey Farwell-18/+20
Fixes https://github.com/rust-lang/rust/issues/49233.
2018-03-27Implement `shrink_to` method on collectionsDiggory Blake-0/+5
2018-03-24Fix build on non-Unix platformsTatsuyuki Ishi-0/+1
2018-03-06Rollup merge of #48618 - scottmcm:elaborate-exitcode, r=alexcrichtonAlex Crichton-0/+13
Better docs and associated SUCCESS/FAILURE for process::ExitCode Follow-up to https://github.com/rust-lang/rust/pull/48497#discussion_r170676525, since that PR was the minimal thing to unblock https://github.com/rust-lang/rust/issues/48453#issuecomment-368155082. r? @nikomatsakis
2018-03-03Move process::ExitCode internals to sysScott McMurray-0/+13
Now begins the saga of fixing compilation errors on other platforms...
2018-02-25Return error if timeout is zero-Duration on Redox.Corey Farwell-2/+18
2018-01-31Use a range to identify SIGSEGV in stack guardsJosh Stone-2/+3
Previously, the `guard::init()` and `guard::current()` functions were returning a `usize` address representing the top of the stack guard, respectively for the main thread and for spawned threads. The `SIGSEGV` handler on `unix` targets checked if a fault was within one page below that address, if so reporting it as a stack overflow. Now `unix` targets report a `Range<usize>` representing the guard memory, so it can cover arbitrary guard sizes. Non-`unix` targets which always return `None` for guards now do so with `Option<!>`, so they don't pay any overhead. For `linux-gnu` in particular, the previous guard upper-bound was `stackaddr + guardsize`, as the protected memory was *inside* the stack. This was a glibc bug, and starting from 2.27 they are moving the guard *past* the end of the stack. However, there's no simple way for us to know where the guard page actually lies, so now we declare it as the whole range of `stackaddr ± guardsize`, and any fault therein will be called a stack overflow. This fixes #47863.
2018-01-26Print inlined functions on WindowsJohn Kåre Alsaker-0/+1
2018-01-02Auto merge of #47042 - redox-os:redox, r=estebankbors-7/+34
Redox - Implement rename using new system call This does the following: - Update syscall module to match upstream - Implement rename using new system call - Make readlink and symlink utilize O_CLOEXEC - Make readlink and symlink not leave dangling file handles on failure
2017-12-31Auto merge of #46713 - Manishearth:memchr, r=blussbors-1/+1
Use memchr to speed up [u8]::contains 3x None
2017-12-27Implement rename using new system callJeremy Soller-7/+34
Fix readlink and symlink to utilize O_CLOEXEC
2017-12-24Auto merge of #46789 - Diggsey:command-env-capture, r=dtolnaybors-17/+7
Capture `Command` environment at spawn Fixes #28975 This tracks a set of changes to the environment and then replays them at spawn time.
2017-12-24Capture environment at spawnDiggory Blake-17/+7
2017-12-19Add Hash impl for SystemTime and InstantVitaly _Vi Shukela-2/+10
Closes #46670.
2017-12-18Add lossless debug implementation for unix OsStrsDiggory Blake-1/+2
2017-12-13Move rust memchr impl to libcoreManish Goregaokar-1/+1
2017-12-06Update miri to rustc changesOliver Schneider-72/+126
2017-11-25Implement `Rc`/`Arc` conversions for string-like typesMurarth-0/+24
Provides the following conversion implementations: * `From<`{`CString`,`&CStr`}`>` for {`Arc`,`Rc`}`<CStr>` * `From<`{`OsString`,`&OsStr`}`>` for {`Arc`,`Rc`}`<OsStr>` * `From<`{`PathBuf`,`&Path`}`>` for {`Arc`,`Rc`}`<Path>`
2017-11-19Add process::parent_idSteven Fackler-0/+4
I have this as a Unix-only API since it seems like Windows doesn't have a similar API.
2017-11-13Rollup merge of #45893 - redox-os:futex_timeout, r=alexcrichtonkennytm-22/+38
Redox: Use futex timeout to implement CondVar::wait_timeout `CondVar::wait_timeout` is implemented by supplying a `TimeSpec` pointer to `futex`. In addition, all calls to `unimplemented!()` have been removed from the Redox `sys` module. Related to https://github.com/rust-lang/rust/pull/45892
2017-11-09Add futex timeoutJeremy Soller-22/+38
2017-11-09std: Avoid use of `libc` in portable modulesAlex Crichton-2/+3
This commit removes usage of the `libc` crate in "portable" modules like those at the top level and `sys_common`. Instead common types like `*mut u8` or `u32` are used instead of `*mut c_void` or `c_int` as well as switching to platform-specific functions like `sys::strlen` instead of `libc::strlen`.
2017-11-08std: Move the `cmath` module into the `sys` moduleAlex Crichton-0/+44
This commit moves the `f32::cmath` and `f64::cmath` modules into the `sys` module. Note that these are not publicly exported modules, simply implementation details. These modules are already platform-specific with shims on MSVC and this is mostly just a reflection of that reality. This should also help cut down on `#[cfg]` traffic if platforms are brought on which don't directly support these functions.
2017-11-08std: Change how EBADF is handled in `sys`Alex Crichton-1/+4
This commit removes the reexport of `EBADF_ERR` as a constant from libstd's portability facade, instead opting for a platform-specific function that specifically queries an `io::Error`. Not all platforms may have a constant for this, so it makes the intent a little more clear that a code need not be supplied, just an answer to a query.
2017-11-08std: Remove `rand` crate and moduleAlex Crichton-46/+4
This commit removes the `rand` crate from the standard library facade as well as the `__rand` module in the standard library. Neither of these were used in any meaningful way in the standard library itself. The only need for randomness in libstd is to initialize the thread-local keys of a `HashMap`, and that unconditionally used `OsRng` defined in the standard library anyway. The cruft of the `rand` crate and the extra `rand` support in the standard library makes libstd slightly more difficult to port to new platforms, namely WebAssembly which doesn't have any randomness at all (without interfacing with JS). The purpose of this commit is to clarify and streamline randomness in libstd, focusing on how it's only required in one location, hashmap seeds. Note that the `rand` crate out of tree has almost always been a drop-in replacement for the `rand` crate in-tree, so any usage (accidental or purposeful) of the crate in-tree should switch to the `rand` crate on crates.io. This then also has the further benefit of avoiding duplication (mostly) between the two crates!
2017-10-06Add current_pid functionThayne McCombs-0/+4
Fixes #44971
2017-09-19Rollup merge of #44513 - redox-os:master, r=alexcrichtonGuillaume Gomez-26/+186
[Redox] Sync with upstream syscall library This syncs the vendored syscalls with their upstream versions.
2017-09-16Fix network familiesJeremy Soller-2/+2
2017-09-14Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichtonbors-0/+2
Add the libstd-modifications needed for the L4Re target This commit adds the needed modifications to compile the std crate for the L4 Runtime environment (L4Re). A target for the L4Re was introduced in commit: c151220a84e40b65e45308cc0f3bbea4466d3acf In many aspects implementations for linux also apply for the L4Re microkernel. Some uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads * L4Re has no uid or gid Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-13Move default stack min size to thread implementationsTobias Schaffner-0/+2
The default min stack size value is smaller on l4re and therefore this value has to be different depending on the platform.
2017-09-11Fix tidy checksJeremy Soller-18/+44
2017-09-11Sync with upstream syscall libraryJeremy Soller-12/+146
2017-09-07Properly detect overflow in Instance +/- Duration.kennytm-7/+15
Avoid unchecked cast from `u64` to `i64`. Use `try_into()` for checked cast. (On Unix, cast to `time_t` instead of `i64`.)
2017-08-24Fix inconsistent doc headingslukaramu-1/+1
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
2017-08-20redox: Correct error on exec when file is not foundIan Douglas Scott-1/+1
`.raw_os_error()` (called in `spawn()`) returned None, so this produced an incorrect error.
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-1/+1
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-4/+4
r=Mark-Simulacrum use field init shorthand EVERYWHERE Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_. r? @Mark-Simulacrum
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-4/+4
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-15Auto merge of #43635 - ids1024:backtrace-redox, r=alexcrichtonbors-32/+159
Make backtraces work on Redox, copying Unix implementation The `backtrace/` directory here is the same as the Unix one, except for adding an implementation of `get_executable_filename`.
2017-08-13Rollup merge of #43821 - NilSet:redox-dns, r=alexcrichtonGuillaume Gomez-14/+12
Handle DNS label compression in more places in Redox name resolution
2017-08-13Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkovGuillaume Gomez-2/+2
Fix some typos Follow up of #43794 If refined my script a little bit and found some more.