summary refs log tree commit diff
path: root/src/libstd/sys/redox
AgeCommit message (Collapse)AuthorLines
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.
2017-08-13Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichtonbors-0/+1
Expose all OS-specific modules in libstd doc. 1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc. 2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness. 3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed. Fixes #24658 (Does _not_ fully implement #1998).
2017-08-12Fix some typosBastien Orivel-2/+2
2017-08-11Handle DNS label compression in more placesThomas Levy-14/+12
2017-08-11Fix some typosBastien Orivel-2/+2
2017-08-10Exposed all platform-specific documentation.kennytm-0/+1
2017-08-03Simplify Redox backtrace/ to not include non-Redox implementationsIan Douglas Scott-207/+3
2017-08-03Make backtraces work on Redox, copying Unix implementationIan Douglas Scott-32/+363
2017-08-04Auto merge of #43459 - ids1024:asrawfd, r=alexcrichtonbors-0/+16
Implement AsRawFd for Stdin, Stdout, and Stderr https://github.com/rust-lang/rfcs/issues/2074
2017-07-29Split FL and FD fcntlsJeremy Soller-10/+12
2017-07-29Redox: Add JoinHandleExt (matching Unix version)Ian Douglas Scott-0/+50
2017-07-25Correct 'stable' attributeIan Douglas Scott-3/+3
2017-07-24Implement AsRawFd for Stdin, Stdout, and StderrIan Douglas Scott-0/+16
2017-07-18Rollup merge of #43304 - ids1024:path2, r=aturonMark Simulacrum-21/+28
redox: handle multiple paths in PATH
2017-07-17redox: handle multiple paths in PATHIan Douglas Scott-21/+28
2017-07-18libstd: remove redundant & from &Path::new(...)NODA, Kai-4/+4
fn Path::new<S: AsRef ...>(s: &S) -> &Path Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-07-14Rollup merge of #43228 - redox-os:backtrace_fix, r=alexcrichtonCorey Farwell-3/+12
Fix backtrace on Redox This fixes sys::backtrace on Redox
2017-07-14Rollup merge of #43202 - jackpot51:patch-1, r=sfacklerCorey Farwell-1/+1
Fix sys::redox::net::tcp A change to the upper level API needed to be filtered down
2017-07-13Fix backtrace on RedoxJeremy Soller-3/+12
2017-07-13Rollup merge of #43204 - jackpot51:patch-3, r=alexcrichtonSteve Klabnik-3/+4
Implement fs::rename in sys::redox This uses a simple implementation of copy + unlink. Redox does not have a rename or link system call for a faster implementation.
2017-07-12Update fs.rsJeremy Soller-1/+1
2017-07-12Update mod.rsJeremy Soller-3/+1
2017-07-12Update fs.rsJeremy Soller-2/+3
2017-07-12Update mod.rsJeremy Soller-17/+1
2017-07-12Update tcp.rsJeremy Soller-1/+1
2017-07-12Rollup merge of #43100 - ids1024:stat2, r=aturonMark Simulacrum-2/+17
Redox: add stat methods(); support is_symlink()
2017-07-11Redox: Use O_NOFOLLOW for lstat()Ian Douglas Scott-1/+5
2017-07-07Redox: Fix Condvar.wait(); do not lock mutex twiceIan Douglas Scott-3/+1
The atomic_xchg() loop locks the mutex, so the call to mutex_lock is incorrect, and blocks.