summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2017-10-09Auto merge of #45041 - est31:master, r=alexcrichtonbors-29/+4
Remove support for the PNaCl target (le32-unknown-nacl) This removes support for the `le32-unknown-nacl` target which is currently supported by rustc on tier 3. Despite the "nacl" in the name, the target doesn't output native code (x86, ARM, MIPS), instead it outputs binaries in the PNaCl format. There are two reasons for the removal: * Google [has announced](https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webassembly.html) deprecation of the PNaCl format. The suggestion is to migrate to wasm. Happens we already have a wasm backend! * Our PNaCl LLVM backend is provided by the fastcomp patch set that the LLVM fork used by rustc contains in addition to vanilla LLVM (`src/llvm/lib/Target/JSBackend/NaCl`). Upstream LLVM doesn't have PNaCl support. Removing PNaCl support will enable us to move away from fastcomp (#44006) and have a lighter set of patches on top of upstream LLVM inside our LLVM fork. This will help distribution packagers of Rust. Fixes #42420
2017-10-08Auto merge of #45030 - raggi:zircon-handle-t, r=alexcrichtonbors-18/+17
zircon: the type of zx_handle_t is now unsigned This is a kernel ABI change that landed today. I noticed some other ABI issues and have left a note to cleanup once they are better defined.
2017-10-05replace libc::res_init with res_init_if_glibc_before_2_26Jack O'Connor-0/+83
The previous workaround for gibc's res_init bug is not thread-safe on other implementations of libc, and it can cause crashes. Use a runtime check to make sure we only call res_init when we need to, which is also when it's safe. See https://github.com/rust-lang/rust/issues/43592.
2017-10-05Remove nacl from libstdest31-29/+4
2017-10-04zircon: update some more zx and lp constantsJames Tucker-22/+16
* Use size_t where size_t is used, while it's not critical on our specifically supported architectures, this is more accurate. * Update HND_SPECIAL_COUNT to the correct value, and give it the size that enum is likely to be.
2017-10-04zircon: the type of zx_handle_t is now unsignedJames Tucker-1/+6
This is a kernel ABI change that landed today. I noticed some other ABI issues and have left a note to cleanup once they are better defined.
2017-10-04Auto merge of #44979 - hinaria:master, r=dtolnaybors-0/+13
make `backtrace = false` compile for windows targets. when building for windows with `backtrace = false`, `libstd` fails to compile because some modules that use items from `sys_common::backtrace::*` are still included, even though those modules aren't used or referenced by anything. `sys_common::backtrace` doesn't exist when the backtrace feature is turned off. -- i've also added `#[cfg(feature = "backtrace")]` to various items that exist exclusively to support `mod backtrace` since the compilation would fail since they would be unused in a configuration with backtraces turned off.
2017-10-03windows: make `backtrace = false` compilehinaria-0/+13
2017-09-27Made `fs::copy` return the length of the main streamStephane Raux-4/+4
On Windows with the NTFS filesystem, `fs::copy` would return the sum of the lengths of all streams, which can be different from the length reported by `metadata` and thus confusing for users unaware of this NTFS peculiarity. This makes `fs::copy` return the same length `metadata` reports which is the value it used to return before PR #26751. Note that alternate streams are still copied; their length is just not included in the returned value. This change relies on the assumption that the stream with index 1 is always the main stream in the `CopyFileEx` callback. I could not find any official document confirming this but empirical testing has shown this to be true, regardless of whether the alternate stream is created before or after the main stream. Resolves #44532
2017-09-24LP_CLONE_FDIO_ROOT is now LP_CLONE_FDIO_NAMESPACEJames Tucker-2/+2
2017-09-24Fixed casing issues.P.Y. Laligand-16/+16
2017-09-24The Magenta kernel is now called Zircon.P.Y. Laligand-134/+134
2017-09-22Auto merge of #44624 - tmerr:master, r=sfacklerbors-3/+3
Retain suid/sgid/sticky bits in Metadata.permissions Most users would expect set_permissions(Metadata.permissions()) to be non-destructive. While we can't guarantee this, we can at least pass the needed info to chmod. Also update the PermissionsExt documentation to disambiguate what it contains, and to refer to the underlying value as `st_mode` rather than its type `mode_t`. Closes #44147
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-17Remove st_mode maskTrevor Merrifield-3/+3
2017-09-16Fix network familiesJeremy Soller-2/+2
2017-09-15Retain suid/sgid/sticky bits in Metadata.permissionsTrevor Merrifield-3/+3
Most users would expect set_permissions(Metadata.permissions()) to be non-destructive. While we can't guarantee this, we can at least pass the needed info to chmod. Also update the PermissionsExt documentation to disambiguate what it contains, and to refer to the underlying value as `st_mode` rather than its type `mode_t`. Closes #44147
2017-09-14Merge branch 'master' into threadnameJoshua Sheard-58/+592
2017-09-14Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichtonbors-21/+508
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-2/+11
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-10Auto merge of #44220 - ↵bors-17/+36
kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton Properly detect overflow in Instance ± Duration. Fix #44216. Fix #42622 The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic. The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second. Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.
2017-09-10Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebankGuillaume Gomez-1/+2
std: Fix a segfault on OSX with backtraces Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-08Move the stack size value for L4Re to the min_stack_size functionSebastian Humenda-4/+0
2017-09-08Re-enable networking module fo rL4ReSebastian Humenda-1/+445
As suggested in the discussion of PR #43972, std should provide a uniform API to all platforms. Since there's no networking on L4Re, this now is a module in `sys::net` providing types and functions/methods returning an error for each action.
2017-09-08Add modifications needed for L4re in libstdTobias Schaffner-8/+42
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. Two uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-08Match c_char definitions and enable signal reset for L4ReSebastian Humenda-13/+17
* Match definition of c_char in os/raw.rs with the libc definition Due to historic reasons, os/raw.rs redefines types for c_char from libc, but these didn't match. Now they do :). * Enable signal reset on exec for L4Re L4Re has full signal emulation and hence it needs to reset the signal set of the child with sigemptyset. However, gid and uid should *not* be set.
2017-09-07Properly detect overflow in Instance +/- Duration.kennytm-17/+36
Avoid unchecked cast from `u64` to `i64`. Use `try_into()` for checked cast. (On Unix, cast to `time_t` instead of `i64`.)
2017-09-06std: Fix a segfault on OSX with backtracesAlex Crichton-1/+2
Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-06Implement named threads on WindowsJoshua Sheard-7/+17
2017-09-02Fallback to dladdr-based resolve_symbol if backtrace failed.kennytm-14/+29
This programs compiled without -g on macOS still provide the resolve to actual symbols, instead of `<unknown>` everywhere.
2017-09-02Use env::current_exe for libbacktrace on macOSJohn Colanduoni-20/+7
2017-09-02Add libbacktrace support for Apple platformsJohn Colanduoni-5/+30
2017-08-28Update the libc submoduleAlex Crichton-8/+27
Brings in a few fixes for wasm/asmjs
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-2/+0
2017-08-27Auto merge of #44112 - alexcrichton:thread-join, r=sfacklerbors-2/+8
std: Handle OS errors when joining threads Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
2017-08-26std: Handle OS errors when joining threadsAlex Crichton-2/+8
Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
2017-08-24Fix inconsistent doc headingslukaramu-2/+2
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-18Auto merge of #43900 - TobiasSchaffner:net_out_of_io, r=alexcrichtonbors-59/+62
Refactoring: move net specific file descriptor methods Move the implementations of net specific file descriptor methods from io to net. This makes it easier to exclude net at all if it is not needed for a target.
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-2/+2
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-16Refactoring: move net specific fd imps to netTobias Schaffner-59/+62
Move the implementations of net specific file descriptior implementations to net. This makes it easier to exclude net at all if not needed for a target.
2017-08-16Auto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, ↵bors-1/+7
r=QuietMisdreavus Clarify writable behavior of readonly-named `Permissions` methods. Opened primarily to fix https://github.com/rust-lang/rust/issues/41984.
2017-08-16Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, ↵bors-19/+19
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-19/+19
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-2/+2
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-15Add comments clarifying behavior of unix `set_readonly` behavior.Corey Farwell-1/+7
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