summary refs log tree commit diff
path: root/library/std/src/sys/unsupported
AgeCommit message (Collapse)AuthorLines
2021-04-30Auto merge of #84522 - CDirkx:cmath, r=yaahcbors-29/+1
Reuse `sys::unix::cmath` on other platforms Reuse `sys::unix::cmath` on all non-`windows` platforms. `unix` is chosen as the canonical location instead of `unsupported` or `common` because `unsupported` doesn't make sense semantically and `common` is reserved for code that is supported on all platforms. Also `unix` is already the home of some non-`windows` code that is technically not exclusive to `unix` like `unix::path`.
2021-04-28Reuse `unix::cmath`Christiaan Dirkx-29/+1
2021-04-25Auto merge of #84115 - CDirkx:rt, r=m-ou-sebors-9/+7
Rework `init` and `cleanup` This PR reworks the code in `std` that runs before and after `main` and centralizes this code respectively in the functions `init` and `cleanup` in both `sys_common` and `sys`. This makes is easy to see what code is executed during initialization and cleanup on each platform just by looking at e.g. `sys::windows::init`. Full list of changes: - new module `rt` in `sys_common` to contain `init` and `cleanup` and the runtime macros. - `at_exit` and the mechanism to register exit handlers has been completely removed. In practice this was only used for closing sockets on windows and flushing stdout, which have been moved to `cleanup`. - <s>On windows `alloc` and `net` initialization is now done in `init`, this saves a runtime check in every allocation and network use.</s>
2021-04-22Rollup merge of #84413 - CDirkx:args_inner_debug, r=m-ou-seDylan DPC-3/+3
Remove `sys::args::Args::inner_debug` and use `Debug` instead This removes the method `sys::args::Args::inner_debug` on all platforms and implements `Debug` for `Args` instead. I believe this creates a more natural API for the different platforms under `sys`: export a type `Args: Debug + Iterator + ...` vs. `Args: Iterator + ...` and with a method `inner_debug`.
2021-04-22Document that `init` and `cleanup` are not guaranteed to runChristiaan Dirkx-0/+2
2021-04-22Move most init to `sys::init`Christiaan Dirkx-5/+1
2021-04-22Remove `sys::args::Args::inner_debug` and use `Debug` insteadChristiaan Dirkx-3/+3
2021-04-22Move all cleanup to `sys::cleanup`Christiaan Dirkx-3/+0
2021-04-22Rework `at_exit` to `cleanup`Christiaan Dirkx-2/+5
2021-04-20Change uses of never typeChristiaan Dirkx-126/+127
2021-04-20Replace `Void` with never typeChristiaan Dirkx-27/+21
2021-04-18Rename `NotSupported` to `Unsupported`Christiaan Dirkx-3/+6
2021-04-18Add and insta-stabilize `std::io::ErrorKind::NotSupported`Christiaan Dirkx-3/+3
2021-03-21Use io::Error::new_const everywhere to avoid allocations.Mara Bos-3/+3
2020-11-14Disambiguate symlink argument namesDavid Tolnay-1/+1
2020-10-14Rollup merge of #77722 - fusion-engineering-forks:safe-unsupported-locks, ↵Yuki Okushi-37/+32
r=Mark-Simulacrum Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn). Replacing `UnsafeCell`s by a `Cell`s simplifies things and makes the mutex and rwlock implementations safe. Other than that, only unsafety in strlen() contained unsafe code. @rustbot modify labels: +F-unsafe-block-in-unsafe-fn +C-cleanup
2020-10-13Add note about using cells in the locks on the 'unsupported' platform.Mara Bos-0/+2
2020-10-09Assert state in sys/unsupported's RwLock::write_unlock.Mara Bos-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2020-10-08Apply deny(unsafe_op_in_unsafe_fn) to all of sys/unsupported.Mara Bos-9/+10
2020-10-08Remove unsafety from unsupported/rwlosck.rs by using a Cell.Mara Bos-18/+16
Replacing the UnsafeCell by a Cell makes it all safe.
2020-10-08Remove unsafety from unsupported/mutex.rs by using a Cell.Mara Bos-14/+8
Replacing the UnsafeCell by a Cell simplifies things and makes it all safe.
2020-10-08Remove unnecessary rustc_const_stable attributes.Mara Bos-1/+0
2020-10-04Auto merge of #77380 - fusion-engineering-forks:unbox-the-mutex, r=dtolnaybors-0/+4
Unbox mutexes and condvars on some platforms Both mutexes and condition variables contained a Box containing the actual os-specific object. This was done because moving these objects may cause undefined behaviour on some platforms. However, this is not needed on Windows[1], Wasm[2], cloudabi[2], and 'unsupported'[3], were the box was only needlessly making them less efficient. This change gets rid of the box on those platforms. On those platforms, `Condvar` can no longer verify it is only used with one `Mutex`, as mutexes no longer have a stable address. This was addressed and considered acceptable in #76932. [1]\: https://docs.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-initializesrwlock [2]\: These are just a single atomic integer together with futex wait/wake calls/instructions. [3]\: The `unsupported` platform doesn't support multiple threads at all.
2020-10-02No longer put condvars on the 'unsupported' platform in a box.Mara Bos-1/+1
These condvars are unsupported and implemented as a ZST, so can be moved without problems.
2020-10-02Make it possible to have unboxed condvars on specific platforms.Mara Bos-0/+2
This commit keeps all condvars boxed on all platforms, but makes it trivial to remove the box on some platforms later.
2020-10-02No longer put mutexes on the 'unsupported' platform in a box.Mara Bos-1/+1
These mutexes are just a bool (in a cell), so can be moved without problems.
2020-10-02Make it possible to have unboxed mutexes on specific platforms.Mara Bos-0/+2
This commit keeps all mutexes boxed on all platforms, but makes it trivial to remove the box on some platforms later.
2020-09-26Add accessors to Command.Eric Huss-1/+38
2020-09-15Consolidate wasi::process and unsupported::processEric Huss-6/+2
2020-09-15Consolidate byte-identical modules.Eric Huss-19/+1
2020-08-21Make raw standard stream constructors constTomasz Miąsko-3/+3
2020-08-21Remove result type from raw standard streams constructorsTomasz Miąsko-6/+6
Raw standard streams constructors are infallible. Remove unnecessary result type.
2020-07-27mv std libs to library/mark-0/+1553