about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2020-05-12Stabilize process_set_argv0 feature for UnixJeremy Fitzhardinge-2/+2
This stabilizes process_set_argv0 targeting 1.45.0. It has been useful in practice and seems useful as-is. The equivalent feature could be implemented for Windows, but as far as I know nobody has. That can be done separately. Tracking issue: #66510
2020-05-07Rollup merge of #71980 - steveklabnik:warnings-fixes, r=Mark-SimulacrumDylan DPC-0/+6
Allow a few warnings. On Windows, these types were causing warnings to be emitted during the build. These types are allowed to not have idiomatic names, so the warning should be supressed.
2020-05-07Allow a few warnings.Steve Klabnik-0/+6
On Windows, these types were causing warnings to be emitted during the build. These types are allowed to not have idiomatic names, so the warning should be supressed.
2020-05-06Rollup merge of #71591 - hermitcore:thread_create, r=hanna-kruppeDylan DPC-7/+6
use new interface to create threads on HermitCore - the new interface allows to define the stack size - increase the default stack size to 1 MByte
2020-05-06Rollup merge of #71921 - RalfJung:open-mode, r=hanna-kruppeDylan DPC-0/+4
explain the types used in the open64 call Fixes https://github.com/rust-lang/rust/issues/71915, where I learned about this quirk. I don't actually know what I am talking about here. ;)
2020-05-05explain the types used in the open64 callRalf Jung-0/+4
2020-05-05rely on rdlock/wrlock not returning anything but the specified error codesRalf Jung-2/+6
2020-05-04edit Mutex commentRalf Jung-4/+6
2020-05-04explain our rwlock implementation (and fix a potential data race)Ralf Jung-20/+24
2020-05-04expand comment on default mutex behaviorRalf Jung-3/+7
2020-05-02Replace `cfg` macro with attribute.Markus Reiter-1/+0
2020-05-02fix formatting issues that fail tidy testCarsten Andrich-16/+16
2020-05-02use or pattern to match error codes that map to ErrorKind::TimedOutCarsten Andrich-15/+15
2020-05-01add Windows system error codes that map to io::ErrorKind::TimedOutCarsten Andrich-2/+30
2020-04-27fix wasiSteven Fackler-2/+2
2020-04-27use nicer code style to define DEFAULT_MIN_STACK_SIZEStefan Lankes-1/+1
2020-04-26fix wasm buildSteven Fackler-0/+8
2020-04-26use new interface to create threads on HermitCoreStefan Lankes-7/+6
- the new interface allows to define the stack size
2020-04-26Fix stragglersSteven Fackler-9/+9
2020-04-26Update nameSteven Fackler-84/+84
2020-04-26Add Read/Write::can_read/write_vectoredSteven Fackler-0/+332
When working with an arbitrary reader or writer, code that uses vectored operations may end up being slower than code that copies into a single buffer when the underlying reader or writer doesn't actually support vectored operations. These new methods allow you to ask the reader or witer up front if vectored operations are efficiently supported. Currently, you have to use some heuristics to guess by e.g. checking if the read or write only accessed the first buffer. Hyper is one concrete example of a library that has to do this dynamically: https://github.com/hyperium/hyper/blob/0eaf304644a396895a4ce1f0146e596640bb666a/src/proto/h1/io.rs#L582-L594
2020-04-15Use fcntl() to set nonblock for solarish socketsPatrick Mooney-0/+8
The ioctl(FIONBIO) method of setting a file descriptor to be non-blocking does not notify the underlying resource in the same way that fcntl(F_SETFL, O_NONBLOCK) does on illumos and Solaris.
2020-04-14Add illumos triplePatrick Mooney-13/+64
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-04-14Add missing commaYoungsuk Kim-1/+1
2020-04-09Rollup merge of #67705 - lzutao:wmemchr, r=wesleywiserMazdak Farrokhzad-2/+46
Use unrolled loop for searching NULL in [u16] on Windows
2020-04-08Rollup merge of #70134 - hermitcore:osstrext, r=dtolnayDylan DPC-0/+53
add basic support of OsStrExt for HermitCore - this patch increases the compatibility to other operating systems - in principle `ffi.rs` is derived from `src/libstd/sys/unix/ext/ffi.rs`
2020-04-06Forward OsStr::clone_into to the inner VecJosh Stone-0/+4
Despite OS differences, they're all just `Vec<u8>` inside, so we can just forward `clone_into` calls to that optimized implementation.
2020-04-06Rollup merge of #70808 - hermitcore:tls, r=dtolnayMazdak Farrokhzad-44/+48
Simplify dtor registration for HermitCore by using a list of destructors The implementation is similar to the macOS version and doesn't depend on additional OS support
2020-04-06Rollup merge of #70553 - hermitcore:abi, r=dtolnayMazdak Farrokhzad-33/+3
move OS constants to platform crate to reduce platform specific constants move O_RDONLY etc. and the definition of thread priorities to hermit-abi
2020-04-05Simplify dtor registration for HermitCore by using a list of destructorsStefan Lankes-44/+48
The implementation is similiar to macOS solution doesn't depend on additional OS support
2020-04-05Stop importing integer modules in libstdLinus Färnstrand-1/+0
2020-04-04Merge branch 'master' into abiStefan Lankes-87/+156
2020-04-04Auto merge of #70136 - hermitcore:network_tcp, r=dtolnaybors-87/+156
add basic IP support in HermitCore - add initial version to support sockets - use TcpStream as test case - HermitCore uses smoltcp as IP stack for pure Rust applications - further functionalities (e.g. UDP support) will be added step by step - in principle, the current PR is a revision of #69404
2020-04-04Merge branch 'master' into abiStefan Lankes-71/+63
2020-04-03Rollup merge of #70597 - vakaras:thread_new_double_free_bug_fix, r=AmanieuMazdak Farrokhzad-66/+59
Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new While working on concurrency support for Miri, I found that the `libstd::syn::unix::Thread::new` method has two potential problems: double-free and undefined behaviour. **Double-free** could occur if the following events happened (credit for pointing this out goes to @RalfJung): 1. The call to `pthread_create` successfully launched a new thread that executed to completion and deallocated `p`. 2. The call to `pthread_attr_destroy` returned a non-zero value causing the `assert_eq!` to panic. 3. Since `mem::forget(p)` was not yet executed, the destructor of `p` would be executed and cause a double-free. As far as I understand, this code also violates the stacked-borrows aliasing rules and thus would result in **undefined behaviour** if these rules were adopted. The problem is that the ownership of `p` is passed to the newly created thread before the call to `mem::forget`. Since the call to `mem::forget` is still a call, it counts as a use of `p` and triggers UB. This pull request changes the code to use `mem::ManuallyDrop` instead of `mem::forget`. As a consequence, in case of a panic, `p` would be potentially leaked, which while undesirable is probably better than double-free or undefined behaviour.
2020-04-03Delete unnecessary stub stack overflow handler for cloudabi.Vytautas Astrauskas-13/+1
2020-04-03Delete unnecessary stub stack overflow handler for hermit.Vytautas Astrauskas-12/+0
2020-04-02Remove unnecessary stack overflow handler stub for sgx.Vytautas Astrauskas-8/+0
2020-04-02Remove unnecessary intermediate pointer cast in Thread::new.Vytautas Astrauskas-1/+1
2020-04-02Remove stack overflow handler stub for wasm.Vytautas Astrauskas-8/+0
2020-04-02Use unrolled looplzutao-9/+43
2020-04-02use of wmemchr for faster searching in [u16]Lzu Tao-2/+12
2020-04-01In Thread::new, add a comment that a panic could cause a memory leak.Vytautas Astrauskas-5/+14
2020-03-31Use Box::into_raw instead of ManuallyDrop in Thread::new.Vytautas Astrauskas-36/+20
2020-04-01Rollup merge of #70081 - lcnr:issue68387, r=varkorDylan DPC-3/+2
add `unused_braces` lint Add the lint `unused_braces` which is warn by default. `unused_parens` is also extended and now checks anon consts. closes #68387 r? @varkor
2020-03-31Inline start_thread into its callers.Vytautas Astrauskas-15/+30
2020-03-31Fix double-free and undefined behaviour in libstd::syn::unix::Thread::new.Vytautas Astrauskas-18/+43
2020-03-31fix internal lint falloutBastian Kauschke-3/+2
2020-03-31Rollup merge of #70613 - matthiaskrgr:cl5ppy_squashed, r=CentrilMazdak Farrokhzad-1/+1
more clippy fixes * use is_empty() instead of len comparison (clippy::len_zero) * use if let instead of while let loop that never loops (clippy::never_loop) * remove redundant returns (clippy::needless_return) * remove redundant closures (clippy::redundant_closure) * use if let instead of match and wildcard pattern (clippy::single_match) * don't repeat field names redundantly (clippy::redundant_field_names) r? @Centril
2020-03-31more clippy fixesMatthias Krüger-1/+1
use is_empty() instead of len comparison (clippy::len_zero) use if let instead of while let loop that never loops (clippy::never_loop) remove redundant returns (clippy::needless_return) remove redundant closures (clippy::redundant_closure) use if let instead of match and wildcard pattern (clippy::single_match) don't repeat field names redundantly (clippy::redundant_field_names)