summaryrefslogtreecommitdiff
path: root/src/libstd/sys
Commit message (Collapse)AuthorAgeFilesLines
* mv std libs to library/mark2020-07-27242-41827/+0
|
* Auto merge of #74681 - RalfJung:miri-extern-fn, r=oli-obkbors2020-07-241-1/+17
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Miri: use extern fn to expose interpreter operations to program; fix leak checker on Windows This PR realizes an idea that @oli-obk has been suggesting for a while: to use Miri-specific `extern` functions to provide some extra capabilities to the program. Initially, we have two of these methods, which libstd itself needs: * `miri_start_panic`, which replaces the intrinsic of the same name (mostly for consistency, to avoid having multiple mechanisms for Miri-specific functionality). * `miri_static_root`, which adds an allocation to a list of static "roots" that Miri considers as not having leaked (including all memory reachable through them). This is needed for https://github.com/rust-lang/miri/issues/1302. We use `extern` functions instead of intrinsics for this so that user code can more easily call these Miri hoolks -- e.g. `miri_static_root` should be useful for https://github.com/rust-lang/miri/issues/1318. The Miri side of this is at https://github.com/rust-lang/miri/pull/1485. r? @oli-obk
| * avoid implicitly returning ()Ralf Jung2020-07-231-1/+2
| |
| * on Windows, use miri_static_root for TLS dtorsRalf Jung2020-07-231-1/+16
| |
* | Rollup merge of #72954 - hermitcore:rwlock, r=dtolnayManish Goregaokar2020-07-242-40/+139
|\ \ | |/ |/| | | | | | | | | | | revise RwLock for HermitCore - current version is derived from the wasm implementation - increasing the readability of `Condvar` - simplify the interface to the libos
| * remove some compiler warningsStefan Lankes2020-06-261-3/+1
| |
| * reorder crates to pass the format checkStefan Lankes2020-06-261-1/+1
| |
| * minor changes to pass the format checkStefan Lankes2020-06-261-6/+2
| |
| * revise RwLock, which is derived from the wasm implementationStefan Lankes2020-06-262-38/+143
| | | | | | | | | | - increasing the readability of `Condvar` - simplify the interface to the libos HermitCore
* | Rollup merge of #74606 - cuviper:cloexec, r=sfacklerManish Goregaokar2020-07-236-195/+74
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove Linux workarounds for missing CLOEXEC support Now that #74163 updated the minimum Linux kernel to 2.6.32, we can assume the availability of APIs that open file descriptors that are already set to close on exec, including the flags `O_CLOEXEC`, `SOCK_CLOEXEC`, and `F_DUPFD_CLOEXEC`. Closes #74519.
| * | Move the pipe2 call behind a hard target `#[cfg]`Josh Stone2020-07-223-21/+29
| | |
| * | Remove Linux workarounds for missing CLOEXEC supportJosh Stone2020-07-214-187/+58
| | | | | | | | | | | | | | | | | | | | | Now that #74163 updated the minimum Linux kernel to 2.6.32, we can assume the availability of APIs that open file descriptors that are already set to close on exec, including the flags `O_CLOEXEC`, `SOCK_CLOEXEC`, and `F_DUPFD_CLOEXEC`.
* | | Rollup merge of #74587 - lzutao:consts, r=dtolnayManish Goregaokar2020-07-233-27/+26
|\ \ \ | | | | | | | | | | | | | | | | | | | | Prefer constant over function Just that I prefer constants over functions that can be made const.
| * | | Prefer constant over functionLzu Tao2020-07-233-28/+27
| |/ /
* | | Rollup merge of #74141 - euclio:typos, r=steveklabnikManish Goregaokar2020-07-234-8/+8
|\ \ \ | |/ / |/| | | | | libstd/libcore: fix various typos
| * | libstd/libcore: fix various typosAndy Russell2020-07-094-8/+8
| | |
* | | Auto merge of #74075 - sunfishcode:wasi-prelude-rawfd, r=alexcrichtonbors2020-07-211-1/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `RawFd` to WASI's `std::os::wasi::prelude`. Add `RawFd` to WASI's `std::os::wasi::prelude`, making it consistent with all other platforms which also have `AsRawFd`, `FromRawFd`, and `IntoRawFd` in their respective preludes.
| * | | Add `RawFd` to WASI's `std::os::wasi::prelude`.Dan Gohman2020-07-051-1/+1
| | |/ | |/| | | | | | | | | | | | | Add `RawFd` to WASI's `std::os::wasi::prelude`, making it consistent with all other platforms which also have `AsRawFd`, `FromRawFd`, and `IntoRawFd` in their respective preludes.
* | | Rollup merge of #74356 - lzutao:rm_combine, r=LukasKalbertodtManish Goregaokar2020-07-191-7/+3
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Remove combine function Comparing two array directly helps generate better assert message. Resolve https://github.com/rust-lang/rust/pull/74271/files#r454538514
| * | | Remove combine functionLzu Tao2020-07-151-7/+3
| | | | | | | | | | | | | | | | Comparing two array directly helps generate better assert message
* | | | Auto merge of #74395 - Mark-Simulacrum:stage0-next, r=pietroalbinibors2020-07-171-2/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bump version to 1.47 This also bumps to a more recent rustfmt version, just to keep us relatively up to date (though almost nothing has changed in rustfmt we use beyond bumps to the parser infra). No formatting changes as a result of this. r? @pietroalbini
| * | | | apply bootstrap cfgsMark Rousskov2020-07-161-2/+2
| | | | |
* | | | | Rollup merge of #74033 - ehuss:std-compile-all-platforms, r=Mark-SimulacrumManish Goregaokar2020-07-1626-105/+237
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add build support for Cargo's build-std feature. This makes some changes to the standard library to make it easier to use with Cargo's build-std feature. The primary goal is to make it so that Cargo and its users do not need to know which crates to build and which features to use for every platform. Conditional cfgs are adjusted so that there is usually a fall-through for unsupported platforms. Additionally, there is a "restricted-std" feature to mark `std` as unstable when used with build-std on no_std platforms. There is no intent to stabilize this feature for the foreseeable future. This borrows some of the implementation for wasm which already does what this needs. More code sharing can be done with some other platforms (there is a lot of duplication with cloudabi, hermit, and sgx), but I figure that can be done in a future PR. There are some small changes to stable behavior in this PR: - `std::env::consts::ARCH` on asmjs now reports "wasm32", to match its actual architecture. - Some of the wasm error messages for unsupported features report a slightly different error message so that the code can be reused. There should otherwise not be any changes to how std is built for distribution via bootstrap. This does not yet support all platforms when used with build-std. - It doesn't work with 16-bit targets (hashbrown does not support that). - It does not work with JSON spec targets. - In particular, all target triple snooping will need to be replaced with appropriate target option checking. - Switching to gimli (#73441) will make cross-building *much* easier. - There are still a ton of issues on the Cargo side to resolve. A big one is panic strategy support. Future PRs are intended to address some of these issues.
| * | | | | Introduce restricted-std feature.Eric Huss2020-07-1526-105/+237
| | |/ / / | |/| | |
* | | | | Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogbManish Goregaokar2020-07-165-27/+213
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable some timeouts in SGX platform This would partially resolve https://github.com/fortanix/rust-sgx/issues/31 cc @jethrogb and @Goirad
| * | | | Move usercall_wait_timeout to abi::usercalls::wait_timeoutMohsen Zohrevandi2020-07-154-82/+74
| | | | |
| * | | | Address review commentsMohsen Zohrevandi2020-07-103-39/+34
| | | | |
| * | | | Remove unnecessary check in SGX wait usercallMohsen Zohrevandi2020-07-011-2/+1
| | | | |
| * | | | Improve wait_timeout_sgx, simplify usercalls::waitMohsen Zohrevandi2020-06-182-28/+56
| | | | |
| * | | | Handle spurious wakeups in wait_timeout_sgxMohsen Zohrevandi2020-06-123-6/+14
| | | | |
| * | | | Enable some timeouts in SGX platformMohsen Zohrevandi2020-06-125-15/+179
| | | | | | | | | | | | | | | | | | | | | | | | | This would partially resolve https://github.com/fortanix/rust-sgx/issues/31
* | | | | Rollup merge of #74291 - regexident:from-docs, r=GuillaumeGomezManish Goregaokar2020-07-154-0/+4
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | Added docs for `From<c_int>` for `ExitStatus` Partially addresses https://github.com/rust-lang/rust/issues/51430
| * | | | Added docs for `From<c_int>` for `ExitStatus`Vincent Esche2020-07-144-0/+4
| | | | |
* | | | | Rollup merge of #74271 - lzutao:cmdbytes, r=LukasKalbertodtManish Goregaokar2020-07-141-14/+12
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | process_unix: prefer i32::*_be_bytes over manually shifting bytes This PR makes it more clear about the intend of the code.
| * | | | | process_unix: prefer i32::*_be_bytes over manually shifting bytesLzu Tao2020-07-121-14/+12
| |/ / / /
* | | | | Rollup merge of #74263 - RalfJung:thread-local, r=Mark-SimulacrumManish Goregaokar2020-07-1419-28/+27
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slight reorganization of sys/(fast_)thread_local I was long confused by the `thread_local` and `fast_thread_local` modules in the `sys(_common)` part of libstd. The names make it *sound* like `fast_thread_local` is just a faster version of `thread_local`, but really these are totally different APIs: one provides thread-local "keys", which are non-addressable pointer-sized pieces of local storage with an associated destructor; the other (the "fast" one) provides just a destructor. So I propose we rename `fast_thread_local` to `thread_local_dtor`, and `thread_local` to `thread_local_key`. That's what this PR does.
| * | | | | adjust remaining targetsRalf Jung2020-07-1215-24/+20
| | | | | |
| * | | | | rename fast_thread_local -> thread_local_dtor; thread_local -> thread_local_keyRalf Jung2020-07-126-6/+9
| | | | | |
* | | | | | Rollup merge of #74220 - lzutao:windows-path-com, r=LukasKalbertodtManish Goregaokar2020-07-142-63/+97
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor Windows `parse_prefix` These changes make me feel more readable. See the commit messages for more details.
| * | | | | | Reduce unsafe scopeLzu Tao2020-07-121-49/+48
| | | | | | |
| * | | | | | Prefer empty OsStr over unsafe cast from [u8]Lzu Tao2020-07-121-1/+1
| | | | | | |
| * | | | | | Rewrite parse_two_compsLzu Tao2020-07-122-10/+41
| | | | | | |
| * | | | | | Make use of slice::strip_prefix and slice patternLzu Tao2020-07-121-27/+24
| | | | | | |
| * | | | | | Make is_valid_drive_letter functionLzu Tao2020-07-121-2/+8
| | | | | | |
| * | | | | | Move constants to top fileLzu Tao2020-07-121-2/+3
| | |/ / / / | |/| | | |
* | | | | | Rollup merge of #73866 - Goirad:fix-entry-improper-ctypes, r=davidtwcoManish Goregaokar2020-07-141-3/+5
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Obviate #[allow(improper_ctypes_definitions)] Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`. cc @jethrogb
| * | | | | Obviate #[allow(improper_ctypes_definitions)]Dario Gonzalez2020-06-291-3/+5
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Modifies the return type for `fn entry` so that allowing improper_ctypes_definitions is no longer necessary. This change is derived from a similar pattern in `libstd/sys/sgx/abi/usercalls/raw.rs` with `UsercallReturn`.
* | | | | Rollup merge of #74076 - sunfishcode:wasi-fileext-newmethods, r=alexcrichtonManish Goregaokar2020-07-101-4/+137
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | Add `read_exact_at` and `write_all_at` to WASI's `FileExt` This adds `read_exact_at` and `write_all_at` to WASI's `FileExt`, similar to the Unix versions of the same names.
| * | | | Make WASI's FileExt's read_at/write_at consistent with other targets.Dan Gohman2020-07-071-4/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rename the existing read_at/write_at to read_vectored_at/write_vectored_at, for consistency with libstd's read_vectored/write_vectored. And, introduce new read_at/write_at functions which take a single buffer, similar to all other targets which provide these functions, so this will make it easier for applications to share code between WASI and other targets. Note that WASI's FileExt is currently unstable.
| * | | | Add `read_exact_at` and `write_all_at` to WASI's `FileExt`Dan Gohman2020-07-071-0/+94
| | |_|/ | |/| | | | | | | | | | | | | | This adds `read_exact_at` and `write_all_at` to WASI's `FileExt`, similar to the Unix versions of the same names.