about summary refs log tree commit diff
path: root/src/libstd/sys/unix/thread.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-465/+0
2020-07-06libstd: remove some mutable statics in sys::unixAndy Russell-12/+15
2020-06-10Migrate to numeric associated constsLzu Tao-1/+1
2020-04-14Add illumos triplePatrick Mooney-2/+2
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-04-01In Thread::new, add a comment that a panic could cause a memory leak.Vytautas Astrauskas-1/+4
2020-03-31Use Box::into_raw instead of ManuallyDrop in Thread::new.Vytautas Astrauskas-9/+4
2020-03-31Inline start_thread into its callers.Vytautas Astrauskas-4/+6
2020-03-31Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new.Vytautas Astrauskas-3/+10
2020-02-16macOS: avoid calling pthread_self() twiceHiroki Noda-2/+3
2020-01-30UpdateHiroki Noda-2/+2
2020-01-30Fix typo.Hiroki Noda-1/+1
2019-11-29Format libstd/sys with rustfmtDavid Tolnay-76/+96
This commit applies rustfmt with rust-lang/rust's default settings to files in src/libstd/sys *that are not involved in any currently open PR* to minimize merge conflicts. THe list of files involved in open PRs was determined by querying GitHub's GraphQL API with this script: https://gist.github.com/dtolnay/aa9c34993dc051a4f344d1b10e4487e8 With the list of files from the script in outstanding_files, the relevant commands were: $ find src/libstd/sys -name '*.rs' \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ rg libstd/sys outstanding_files | xargs git checkout -- Repeating this process several months apart should get us coverage of most of the rest of the files. To confirm no funny business: $ git checkout $THIS_COMMIT^ $ git show --pretty= --name-only $THIS_COMMIT \ | xargs rustfmt --edition=2018 --unstable-features --skip-children $ git diff $THIS_COMMIT # there should be no difference
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-1/+0
- the old interface between HermitCore and the Rust Standard Library based on a small C library (newlib) - remove this interface and call directly the unikernel - remove the dependency to the HermitCore linker - use rust-lld as linker
2019-08-06redox: convert to target_family unixJeremy Soller-1/+2
2019-08-02provide thread name to OS for Solarish systemsJohn Levon-1/+14
2019-05-13Remove bitrig support from rustMarcel Hellwig-7/+2
2019-04-10Eliminate `FnBox` usages from libstd.CrLF0710-2/+1
2019-02-28libstd => 2018Taiki Endo-22/+21
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-14Remove dead codeOliver Scherer-21/+0
2018-12-06Change sys::Thread::new to take the thread entry as Box<dyn FnBox() + 'static>̣Jethro Beekman-1/+2
2018-07-30Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and ↵Colin Finck-1/+2
port libstd to it. As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible. It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development). Together with the patches to "liblibc" and "llvm", this enables HermitCore applications to be written in Rust.
2018-07-10Add missing `dyn` for cloudabi, redox, unix and wasmljedrz-1/+1
2018-05-02Add comments and unify guard page setup.Martin Husemann-16/+13
While currently only NetBSD seems to be affected, all systems implementing PAX MPROTECT in strict mode need this treatment, and it does not hurt others.
2018-04-30Map the stack guard page with max protection on NetBSDMartin Husemann-4/+16
On NetBSD the initial mmap() protection of a mapping can not be made less restrictive with mprotect(). So when mapping a stack guard page, use the maximum protection we ever want to use, then mprotect() it to the permission we want it to have initially.
2018-04-12Import the `alloc` crate as `alloc_crate` in stdSimon Sapin-1/+1
… to make the name `alloc` available.
2018-04-03Fix importsTatsuyuki Ishi-1/+1
2018-03-28Use mprotect instead of mmapTatsuyuki Ishi-3/+2
2018-03-25Use a more conservative way to deinit stack guardTatsuyuki Ishi-5/+15
2018-03-24Fix build on non-Unix platformsTatsuyuki Ishi-0/+1
2018-03-20Refactor the stack addr aligning code into a functionTatsuyuki Ishi-16/+16
2018-03-19Address review commentsTatsuyuki Ishi-1/+19
2018-01-31Use a range to identify SIGSEGV in stack guardsJosh Stone-45/+70
Previously, the `guard::init()` and `guard::current()` functions were returning a `usize` address representing the top of the stack guard, respectively for the main thread and for spawned threads. The `SIGSEGV` handler on `unix` targets checked if a fault was within one page below that address, if so reporting it as a stack overflow. Now `unix` targets report a `Range<usize>` representing the guard memory, so it can cover arbitrary guard sizes. Non-`unix` targets which always return `None` for guards now do so with `Option<!>`, so they don't pay any overhead. For `linux-gnu` in particular, the previous guard upper-bound was `stackaddr + guardsize`, as the protected memory was *inside* the stack. This was a glibc bug, and starting from 2.27 they are moving the guard *past* the end of the stack. However, there's no simple way for us to know where the guard page actually lies, so now we declare it as the whole range of `stackaddr ± guardsize`, and any fault therein will be called a stack overflow. This fixes #47863.
2018-01-18in which the unused-parens lint comes to cover function and method argsZack M. Davis-2/+2
Resolves #46137.
2017-12-09Use Try syntax for Option in place of macros or matchMatt Brubeck-4/+1
2017-11-09std: Avoid use of `libc` in portable modulesAlex Crichton-1/+1
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-10-20Fix some tests for linux gnux32Marco A L Barbosa-1/+1
2017-09-13Move default stack min size to thread implementationsTobias Schaffner-0/+5
The default min stack size value is smaller on l4re and therefore this value has to be different depending on the platform.
2017-09-08Move the stack size value for L4Re to the min_stack_size functionSebastian Humenda-4/+0
2017-09-08Add modifications needed for L4re in libstdTobias Schaffner-2/+8
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-08-26std: Handle OS errors when joining threadsAlex Crichton-1/+2
Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
2017-07-07Skip the main thread's manual stack guard on LinuxJosh Stone-15/+29
Linux doesn't allocate the whole stack right away, and the kernel has its own stack-guard mechanism to fault when growing too close to an existing mapping. If we map our own guard, then the kernel starts enforcing a rather large gap above that, rendering much of the possible stack space useless. Instead, we'll just note where we expect rlimit to start faulting, so our handler can report "stack overflow", and trust that the kernel's own stack guard will work. Fixes #43052.
2016-10-22Fix tidy warningRaph Levien-1/+1
Prefer FIXME to TODO
2016-10-22Add Fuchsia supportRaph Levien-0/+4
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-10-08Use less `size_t` casts in libstd since it's now defined as `usize`Tobias Bucher-17/+12
2016-09-30Call emcc with ERROR_ON_UNDEFINED_SYMBOLSBrian Anderson-2/+16
2016-09-26Haiku: Use common thread set_name stubAlexander von Gluck IV-7/+5
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-0/+5
* Hand rebased from Niels original work on 1.9.0
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-4/+0
2016-08-10[emscripten] Disable code paths that don't work on emscriptenJan-Erik Rediger-4/+3