about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2019-02-23Rollup merge of #58453 - jethrogb:jb/sgx-panic-abort, r=nagisaMazdak Farrokhzad-0/+1
SGX target: fix panic = abort What is the difference between `no_mangle` and `rustc_std_internal_symbol`?
2019-02-22Rollup merge of #58059 - RalfJung:before_exec, r=alexcrichtonMazdak Farrokhzad-12/+56
deprecate before_exec in favor of unsafe pre_exec Fixes https://github.com/rust-lang/rust/issues/39575 As per the [lang team decision](https://github.com/rust-lang/rust/issues/39575#issuecomment-442993358): > The language team agreed that before_exec should be unsafe, and leaves the details of a transition plan to the libs team. Cc @alexcrichton @rust-lang/libs how would you like to proceed?
2019-02-16Rollup merge of #58438 - cuviper:posix_spawn_file_actions_addchdir_np, ↵kennytm-2/+22
r=alexcrichton Use posix_spawn_file_actions_addchdir_np when possible This is a non-POSIX extension implemented in Solaris and in glibc 2.29. With this we can still use `posix_spawn()` when `Command::current_dir()` has been set, otherwise we fallback to `fork(); chdir(); exec()`.
2019-02-14SGX target: fix panic = abortJethro Beekman-0/+1
2019-02-13Use posix_spawn_file_actions_addchdir_np when possibleJosh Stone-2/+22
This is a non-POSIX extension implemented in Solaris and in glibc 2.29. With this we can still use `posix_spawn()` when `Command::current_dir()` has been set, otherwise we fallback to `fork(); chdir(); exec()`.
2019-02-13Auto merge of #58235 - jethrogb:jb/sgx-usercall-internals, r=alexcrichtonbors-81/+59
SGX target: simplify usercall internals This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling. Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers. cc @VardhanThigle r? @alexcrichton
2019-02-12Auto merge of #58341 - alexreg:cosmetic-2-doc-comments, r=steveklabnikbors-137/+142
Cosmetic improvements to doc comments This has been factored out from https://github.com/rust-lang/rust/pull/58036 to only include changes to documentation comments (throughout the rustc codebase). r? @steveklabnik Once you're happy with this, maybe we could get it through with r=1, so it doesn't constantly get invalidated? (I'm not sure this will be an issue, but just in case...) Anyway, thanks for your advice so far!
2019-02-11remove "experimental" wording from std::os::unixAndy Russell-1/+1
2019-02-10libs: doc commentsAlexander Regueiro-125/+130
2019-02-10tests: doc commentsAlexander Regueiro-12/+12
2019-02-10Auto merge of #58361 - GuillaumeGomez:rollup, r=GuillaumeGomezbors-3/+3
Rollup of 16 pull requests Successful merges: - #57259 (Update reference of rlibc crate to compiler-builtins crate) - #57740 (Use `to_ne_bytes` for converting IPv4Addr to octets) - #57926 (Tiny expansion to docs for `core::convert`.) - #58157 (Add Cargo.lock automatically adding message) - #58203 (rustdoc: display sugared return types for async functions) - #58243 (Add trait alias support in rustdoc) - #58262 (Add #[must_use] message to Fn* traits) - #58295 (std::sys::unix::stdio: explain why we do into_raw) - #58297 (Cleanup JS a bit) - #58317 (Some writing improvement, conciseness of intro) - #58324 (miri: give non-generic functions a stable address) - #58332 (operand-to-place copies should never be overlapping) - #58345 (When there are multiple filenames, print what got interpreted as filenames) - #58346 (rpath computation: explain why we pop()) - #58350 (Fix failing tidy (line endings on Windows)) - #58352 (miri value visitor: use `?` in macro) Failed merges: r? @ghost
2019-02-10Rollup merge of #58295 - RalfJung:stdio, r=alexcrichtonGuillaume Gomez-3/+3
std::sys::unix::stdio: explain why we do into_raw I was quite puzzled why someone would call `into_raw` and then ignore the result.
2019-02-10Auto merge of #58129 - RalfJung:maybe-uninit, r=cramertjbors-2/+2
MaybeUninit: some docs, rename into_inner -> into_initialized, return &mut from set
2019-02-10fix SGX build failuresRalf Jung-2/+2
2019-02-08std::sys::unix::stdio: explain why we do into_rawRalf Jung-3/+3
2019-02-07Rollup merge of #58136 - abonander:doc-win-stdio-unicode, r=dtolnaykennytm-1/+3
Improve error message and docs for non-UTF-8 bytes in stdio on Windows This should make debugging problems like abonander/multipart#106 significantly more straightforward in the future. cc #23344, @retep998 @alexcrichton Not sure who do r? so I'll let rust-highfive pick one.
2019-02-06SGX target: simplify usercall internalsJethro Beekman-81/+59
This moves logic from assembly to Rust and removes the special case for exit/panic handling, merging it with regular usercall handling. Also, this fixes a bug in the exit usercall introduced in a75ae00. The bug would make regular exits look like panics with high probability. It would also with some probability leak information through uncleared registers.
2019-02-06Rollup merge of #58182 - jethrogb:jb/sgx-bytebuffer-len-0, r=joshtriplettkennytm-2/+8
SGX target: handle empty user buffers correctly Also, expose correct items in `os::fortanix_sgx::usercalls::alloc` * [read_alloc documentation](https://edp.fortanix.com/docs/api/fortanix_sgx_abi/struct.Usercalls.html#method.read_alloc) * [Clarified ByteBuffer documentation](https://github.com/fortanix/rust-sgx/pull/94/files#diff-ca843ad9e25cacd63a80579c0f7efa56) r? @joshtriplett
2019-02-05SGX target: handle empty user buffers correctlyJethro Beekman-2/+8
2019-02-04Remove stray FIXMEJethro Beekman-3/+0
2019-02-03Improve error message and docs for non-UTF-8 bytes in stdio on WindowsAustin Bonander-1/+3
cc #23344
2019-02-03Auto merge of #57922 - davidtwco:issue-57410, r=petrochenkovbors-0/+2
Update visibility of intermediate use items. Fixes #57410 and fixes #53925 and fixes #47816. Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This PR ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
2019-02-03POSIX requires async signal safety for fork in signal handlers, not in generalRalf Jung-4/+2
2019-02-03more formattingRalf Jung-4/+8
2019-02-02Update visibility of intermediate use items.David Wood-0/+2
Currently, the target of a use statement will be updated with the visibility of the use statement itself (if the use statement was visible). This commit ensures that if the path to the target item is via another use statement then that intermediate use statement will also have the visibility updated like the target. This silences incorrect `unreachable_pub` lints with inactionable suggestions.
2019-02-02pre_exec: expand docsRalf Jung-6/+8
2019-02-02deprecate things a bit slowerRalf Jung-2/+2
2019-02-01also replace before_exec by pre_exec on redoxRalf Jung-6/+26
2019-02-01deprecate before_exec in favor of unsafe pre_execRalf Jung-4/+24
2019-02-01Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`Jethro Beekman-4/+9
Fixes https://github.com/fortanix/rust-sgx/issues/88
2019-01-29SGX target: improve panic & exit handlingJethro Beekman-22/+32
2019-01-26Replace deprecated ATOMIC_INIT constsMark Rousskov-10/+43
2019-01-24Rollup merge of #57860 - jethrogb:jb/sgx-os-ffi, r=joshtriplettMazdak Farrokhzad-0/+110
Add os::fortanix_sgx::ffi module This uses the same byte slice accessors that Unix has. The [ABI specifies](https://docs.rs/fortanix-sgx-abi/0.3.2/fortanix_sgx_abi/struct.ByteBuffer.html) byte slices.
2019-01-24Rollup merge of #57803 - jethrogb:jb/sgx-unwind-version, r=alexcrichtonMazdak Farrokhzad-0/+15
Several changes to libunwind for SGX target Two fixes: * #34978 bites again! * __rust_alloc are actually private symbols. Add new public versions. Also, these ones are `extern "C"`. Upstream changes (https://github.com/fortanix/llvm-project/pull/2, https://github.com/fortanix/llvm-project/pull/3): * b7357de Avoid too new relocation types being emitted * 0feefe5 Use new symbol names to call Rust allocator Fixes https://github.com/fortanix/rust-sgx/issues/65
2019-01-23Add a comment on the meaning of Instant t: DurationAlex Berghage-0/+2
2019-01-23Add os::fortanix_sgx::ffi moduleJethro Beekman-0/+110
2019-01-22Rebase and fix new instantiation fnAlex Berghage-1/+1
2019-01-22Move Instant backing type to DurationAlex Berghage-22/+14
Per review comments, this commit switches out the backing type for Instant on windows to a Duration. Tests all pass, and the code's a lot simpler (plus it should be portable now, with the exception of the QueryPerformanceWhatever functions).
2019-01-22Simplify units in Duration/Instant math on WindowsAlex Berghage-42/+78
Right now we do unit conversions between PerfCounter measurements and nanoseconds for every add/sub we do between Durations and Instants on Windows machines. This leads to goofy behavior, like this snippet failing: ``` let now = Instant::now(); let offset = Duration::from_millis(5); assert_eq!((now + offset) - now, (now - now) + offset); ``` with precision problems like this: ``` thread 'main' panicked at 'assertion failed: `(left == right)` left: `4.999914ms`, right: `5ms`', src\main.rs:6:5 ``` To fix it, this changeset does the unit conversion once, when we measure the clock, and all the subsequent math in u64 nanoseconds. It also adds an exact associativity test to the `sys/time.rs` test suite to make sure we don't regress on this in the future.
2019-01-21Expose alloc/dealloc properly for SGX libunwindJethro Beekman-0/+15
2019-01-20Auto merge of #57655 - mtak-:fix-tls-dtors-macos, r=alexcrichtonbors-17/+44
OSX: fix #57534 registering thread dtors while running thread dtors r? @alexcrichton - "fast" `thread_local` destructors get run even on the main thread - "fast" `thread_local` dtors, can initialize other `thread_local`'s One corner case where this fix doesn't work, is when a C++ `thread_local` triggers the initialization of a rust `thread_local`. I did not add any std::thread specific flag to indicate that the thread is currently exiting, which would be checked before registering a new dtor (I didn't really know where to stick that). I think this does the trick tho! Let me know if anything needs tweaking/fixing/etc. resolves this for macos: https://github.com/rust-lang/rust/issues/28129 fixes: https://github.com/rust-lang/rust/issues/57534
2019-01-17Auto merge of #57520 - alexreg:tidy-copyright-lint, r=Mark-Simulacrumbors-8/+5
Add lint for copyright headers to 'tidy' tool r? @Mark-Simulacrum CC @centril
2019-01-15OSX: fix #57534 registering thread dtors while running thread dtorstyler-17/+44
2019-01-15Stabilize FileExt::read_exact_at/write_all_atDror Levin-4/+2
Closes #51984.
2019-01-15Auto merge of #57130 - ↵bors-0/+19
VardhanThigle:Vardhan/x86_64-fortanix-unknown-sgx-tier2_support, r=alexcrichton Upgrade x86_64-fortanix-unknown-sgx platform support to tier 2 ## Overview 1. This PR upgrades x86_64-fortanix-unknown-sgx platform support to tier 2 (std only) by setting up build automation for this target. 1. For supporting unwinding, this target needs to link to a port of LLVM's libunwind (more details could be found in #56979), which will be distributed along with the Rust binaries (similar to the extra musl objects) ### Building and copying libunwind: We have added a new build script (`build-x86_64-fortanix-unknown-sgx-toolchain.sh`) that will run while the container is built. This will build `libunwind.a` from git source. While the container is built, the persistent volumes where obj/ gets created aren't yet mapped. As a workaround, we copy the built `libunwind.a` to `obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-fortanix-unknown-sgx/lib/` after x.py runs. If any reviewer knows of a better solution, please do tell. r? @Mark-Simulacrum
2019-01-13Cosmetic improvementsAlexander Regueiro-8/+5
2019-01-13Fix breakage from #56988 and workaround for #57569Vardhan Thigle-0/+9
2019-01-13Adding Build automation for x86_64-fortanix-unknown-sgxVardhan Thigle-0/+10
2019-01-13Rollup merge of #57473 - alexcrichton:hex-display-on-windows, r=KimundiMazdak Farrokhzad-1/+10
std: Render large exit codes as hex on Windows On Windows process exit codes are never signals but rather always 32-bit integers. Most faults like segfaults and such end up having large integers used to represent them, like STATUS_ACCESS_VIOLATION being 0xC0000005. Currently, however, when an `ExitStatus` is printed this ends up getting rendered as 3221225477 which is somewhat more difficult to debug. This commit adds a branch in `Display for ExitStatus` on Windows which handles exit statuses where the high bit is set and prints those exit statuses as hex instead of with decimals. This will hopefully preserve the current display for small exit statuses (like `exit code: 22`), but assist in quickly debugging segfaults/access violations/etc. I've found at least that the hex codes are easier to search for than decimal. I wasn't able to find any official documentation saying that all system exit codes have the high bit set, but I figure it's a good enough heuristic for now.
2019-01-12Rollup merge of #57511 - jethrogb:jb/fix-undef, r=cramertjMazdak Farrokhzad-2/+2
Fix undefined behavior From the [`MaybeUninit::get_mut` docs](https://doc.rust-lang.org/std/mem/union.MaybeUninit.html): > It is up to the caller to guarantee that the the MaybeUninit really is in an initialized state, otherwise this will immediately cause undefined behavior. r? @joshtriplett