about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2016-10-01std: Move platform specific path code into sysBrian Anderson-0/+139
2016-10-01Auto merge of #36824 - kali:master, r=alexcrichtonbors-5/+27
SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426) I'm not sure what happened when I pushed a rebased branch on #36426 , github closed it...
2016-09-30Call emcc with ERROR_ON_UNDEFINED_SYMBOLSBrian Anderson-5/+18
2016-09-30Ignore various entire test modules on emscriptenBrian Anderson-19/+3
2016-09-30Ignore lots and lots of std tests on emscriptenBrian Anderson-0/+18
2016-09-28use MSG_NOSIGNAL from liblibcMathieu Poumeyrol-10/+6
2016-09-28MSG_NOSIGNAL on linuxMathieu Poumeyrol-4/+18
2016-09-28set SO_NOSIGPIPE on apple platformsMathieu Poumeyrol-1/+13
2016-09-28[breaking-change] std: change `encode_utf{8,16}()` to take a buffer and ↵tormol-9/+12
return a slice They panic if the buffer is too small.
2016-09-26Rollup merge of #36754 - tmiasko:getaddrinfo-errors, r=alexcrichtonJonathan Turner-2/+7
When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno. Fixes issue #36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant. Previously, in cases where `EAI_SYSTEM` has been returned from getaddrinfo, the resulting `io::Error` would be broadly described as "System error": Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) } After change a more detailed error is crated based on particular value of errno, for example: Error { repr: Os { code: 64, message: "Machine is not on the network" } } The only downside is that the prefix "failed to lookup address information" is no longer included in the error message.
2016-09-26When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.Tomasz Miąsko-2/+7
Fixes issue #36546. This change also updates libc to earliest version that includes EAI_SYSTEM constant.
2016-09-26Haiku: Use common thread set_name stubAlexander von Gluck IV-7/+5
2016-09-25Haiku: Work around the lack of the FIOCLEX ioctlNiels Sascha Reedijk-2/+8
* Hand rebased from Niels original work on 1.9.0
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-11/+70
* Hand rebased from Niels original work on 1.9.0
2016-09-11Use question_mark feature in libstd.Ahmed Charles-2/+2
2016-09-09Add s390x supportUlrich Weigand-4/+10
This adds support for building the Rust compiler and standard library for s390x-linux, allowing a full cross-bootstrap sequence to complete. This includes: - Makefile/configure changes to allow native s390x builds - Full Rust compiler support for the s390x C ABI (only the non-vector ABI is supported at this point) - Port of the standard library to s390x - Update the liblibc submodule to a version including s390x support - Testsuite fixes to allow clean "make check" on s390x Caveats: - Resets base cpu to "z10" to bring support in sync with the default behaviour of other compilers on the platforms. (Usually, upstream supports all older processors; a distribution build may then chose to require a more recent base version.) (Also, using zEC12 causes failures in the valgrind tests since valgrind doesn't fully support this CPU yet.) - z13 vector ABI is not yet supported. To ensure compatible code generation, the -vector feature is passed to LLVM. Note that this means that even when compiling for z13, no vector instructions will be used. In the future, support for the vector ABI should be added (this will require common code support for different ABIs that need different data_layout strings on the same platform). - Two test cases are (temporarily) ignored on s390x to allow passing the test suite. The underlying issues still need to be fixed: * debuginfo/simd.rs fails because of incorrect debug information. This seems to be a LLVM bug (also seen with C code). * run-pass/union/union-basic.rs simply seems to be incorrect for all big-endian platforms. Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-08Auto merge of #36322 - uweigand:nonblocking, r=alexcrichtonbors-1/+1
Fix argument to FIONBIO ioctl The FIONBIO ioctl takes as argument a pointer to an integer, which should be either 0 or 1 to indicate whether nonblocking mode is to be switched off or on. The type of the pointed-to variable is "int". However, the set_nonblocking routine in libstd/sys/unix/net.rs passes a pointer to a libc::c_ulong variable. This doesn't matter on all 32-bit platforms and on all litte-endian platforms, but it will break on big-endian 64-bit platforms. Found while porting Rust to s390x (a big-endian 64-bit platform). Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-08Auto merge of #36048 - GuillaumeGomez:code_clean, r=brsonbors-12/+9
Clean code a bit
2016-09-07Fix argument to FIONBIO ioctlUlrich Weigand-1/+1
The FIONBIO ioctl takes as argument a pointer to an integer, which should be either 0 or 1 to indicate whether nonblocking mode is to be switched off or on. The type of the pointed-to variable is "int". However, the set_nonblocking routine in libstd/sys/unix/net.rs passes a pointer to a libc::c_ulong variable. This doesn't matter on all 32-bit platforms and on all litte-endian platforms, but it will break on big-endian 64-bit platforms. Found while porting Rust to s390x (a big-endian 64-bit platform). Signed-off-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
2016-09-04Replace `_, _, _` with `..`Vadim Petrochenkov-1/+1
2016-08-30Auto merge of #35048 - tmiasko:monotonic-wait-timeout, r=alexcrichtonbors-8/+69
Use monotonic time in condition variables. Configure condition variables to use monotonic time using pthread_condattr_setclock on systems where this is possible. This fixes the issue when thread waiting on condition variable is woken up too late when system time is moved backwards.
2016-08-29Avoid using pthread_condattr_setclock on Android.Tomasz Miąsko-4/+4
The pthread_condattr_setclock is available only since Android 5.0 and API level 21.
2016-08-28Improve Demangling of Rust SymbolsChristopher Serr-19/+47
This turns `..` into `::`, handles some more escapes and gets rid of unwanted underscores at the beginning of path elements. ![Image of Diff](http://puu.sh/qQIN3.png)
2016-08-27Clean code a bitGuillaume Gomez-12/+9
2016-08-25Auto merge of #35906 - jseyfried:local_prelude, r=eddybbors-77/+0
Use `#[prelude_import]` in `libcore` and `libstd` r? @eddyb
2016-08-25Auto merge of #35884 - habnabit:freebsd-arc4rand, r=alexcrichtonbors-30/+77
Use arc4rand(9) on FreeBSD From rust-lang-nursery/rand#112: >After reading through #30691 it seems that there's general agreement that using OS-provided facilities for seeding rust userland processes is fine as long as it doesn't use too much from libc. FreeBSD's `arc4random_buf(3)` is not only a whole lot of libc code, but also not even currently exposed in the libc crate. Fortunately, the mechanism `arc4random_buf(3)` et al. use for getting entropy from the kernel ([`arc4rand(9)`](https://www.freebsd.org/cgi/man.cgi?query=arc4random&apropos=0&sektion=9&manpath=FreeBSD+10.3-RELEASE&arch=default&format=html)) is exposed via `sysctl(3)` with constants that are already in the libc crate. >I haven't found too much documentation on `KERN_ARND`—it's missing or only briefly described in most of the places that cover sysctl mibs. But, from digging through the kernel source, it appears that the sysctl used in this PR is very close to just calling `arc4rand(9)` directly (with `reseed` set to 0 and no way to change it). I expected [rand](/rust-lang-nursery/rand) to reply quicker, so I tried submitting it there first. It's been a few weeks with no comment, so I don't know the state of it, but maybe someone will see it here and have an opinion. This is basically the same patch. It pains me to duplicate the code but I guess it hasn't been factored out into just one place yet.
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-77/+0
2016-08-22Rollup merge of #35842 - apasel422:typo, r=GuillaumeGomezJonathan Turner-2/+2
Fix typos in unix/rwlock.rs r? @steveklabnik
2016-08-21Use the kernel arc4rand for FreeBSD OsRng.Aaron Gallagher-1/+52
This means that /dev/urandom doesn't have to be opened.
2016-08-21Reduce duplication in std::sys::unix::rand.Aaron Gallagher-29/+25
There were a bunch of more-of-less the same few lines for doing a fill_bytes+transmute, and I didn't want to copy-paste it yet again.
2016-08-19Fix typos in unix/rwlock.rsAndrew Paseltiner-2/+2
2016-08-19std: Stabilize APIs for the 1.12 releaseAlex Crichton-2/+3
Stabilized * `Cell::as_ptr` * `RefCell::as_ptr` * `IpAddr::is_{unspecified,loopback,multicast}` * `Ipv6Addr::octets` * `LinkedList::contains` * `VecDeque::contains` * `ExitStatusExt::from_raw` - both on Unix and Windows * `Receiver::recv_timeout` * `RecvTimeoutError` * `BinaryHeap::peek_mut` * `PeekMut` * `iter::Product` * `iter::Sum` * `OccupiedEntry::remove_entry` * `VacantEntry::into_key` Deprecated * `Cell::as_unsafe_cell` * `RefCell::as_unsafe_cell` * `OccupiedEntry::remove_pair` Closes #27708 cc #27709 Closes #32313 Closes #32630 Closes #32713 Closes #34029 Closes #34392 Closes #34285 Closes #34529
2016-08-14Rollup merge of #35574 - badboy:emscripten-test-fixes, r=brsonEduard-Mihai Burtescu-8/+9
Emscripten test fixes This picks up parts of #31623 to disable certain tests that emscripten can't run, as threads/processes are not supported. I re-applied @tomaka's changes manually, I can rebase those commits with his credentials if he wants. It also disables jemalloc for emscripten (at least in Rustbuild, I have to check if there is another setting for the same thing in the old makefile approach). This should not impact anything for normal builds.
2016-08-10Clarify std::os::unix::net::SocketAddr::is_unnamed's docstringPietro Albini-1/+1
2016-08-10Fix docs typo in std::os::unix::net::SocketAddr::is_unnamedPietro Albini-1/+1
2016-08-10[emscripten] Disable code paths that don't work on emscriptenJan-Erik Rediger-8/+9
2016-08-09Auto merge of #35426 - frewsxcv:os-sys-env-args-phantoms, r=alexcrichtonbors-6/+7
Utilize `PhantomData` to enforce `!Sync` and `!Send` field. None
2016-08-07Rollup merge of #35433 - mneumann:dragonfly-fix-libstd-errno-location, ↵Jonathan Turner-0/+1
r=alexcrichton Fix build on DragonFly (unused function errno_location) Function errno_location() is not used on DragonFly. As warnings are errors, this breaks the build.
2016-08-07Utilize `PhantomData` to enforce `!Sync` and `!Send` field.Corey Farwell-6/+7
2016-08-06Auto merge of #35378 - Amanieu:rwlock_eagain, r=alexcrichtonbors-1/+3
Handle RwLock reader count overflow `pthread_rwlock_rdlock` may return `EAGAIN` if the maximum reader count overflows. We shouldn't return a successful lock in that case.
2016-08-06Fix build on DragonFly (unused function errno_location)Michael Neumann-0/+1
Function errno_location() is not used on DragonFly. As warnings are errors, this breaks the build.
2016-08-06Rollup merge of #34916 - tbu-:pr_comment_on_seek_cast, r=GuillaumeGomezEduard-Mihai Burtescu-4/+8
Comment on the casts in the `seek` implementations on files
2016-08-05Handle RwLock reader count overflowAmanieu d'Antras-1/+3
2016-08-05Comment on the casts in the `seek` implementations on filesTobias Bucher-4/+8
2016-08-02Auto merge of #35084 - tbu-:pr_lowercase_wtf8_debug, r=brsonbors-2/+2
Escape the unmatched surrogates with lower-case hexadecimal numbers It's done the same way for the rest of the codepoint escapes.
2016-07-31Use monotonic time with condition variables.Tomasz Miąsko-8/+69
Configure condition variables to use monotonic time using pthread_condattr_setclock on systems where this is possible. This fixes the issue when thread waiting on condition variable is woken up too late when system time is moved backwards.
2016-07-30Auto merge of #35051 - japaric:backtrace, r=alexcrichtonbors-0/+3
rustbuild: make backtraces (RUST_BACKTRACE) optional but keep them enabled by default to maintain the status quo. When disabled shaves ~56KB off every x86_64-unknown-linux-gnu binary. To disable backtraces you have to use a config.toml (see src/bootstrap/config.toml.example for details) when building rustc/std: $ python bootstrap.py --config=config.toml --- r? @alexcrichton cc rust-lang/rfcs#1417
2016-07-29Rollup merge of #35087 - GuillaumeGomez:fs_docs, r=steveklabnikGuillaume Gomez-0/+50
Fs docs Fixes #29356. r? @steveklabnik
2016-07-29Escape the unmatched surrogates with lower-case hexadecimal numbersTobias Bucher-2/+2
It's done the same way for the rest of the codepoint escapes.
2016-07-28Auto merge of #34485 - tbu-:pr_unicode_debug_str, r=alexcrichtonbors-3/+3
Escape fewer Unicode codepoints in `Debug` impl of `str` Use the same procedure as Python to determine whether a character is printable, described in [PEP 3138]. In particular, this means that the following character classes are escaped: - Cc (Other, Control) - Cf (Other, Format) - Cs (Other, Surrogate), even though they can't appear in Rust strings - Co (Other, Private Use) - Cn (Other, Not Assigned) - Zl (Separator, Line) - Zp (Separator, Paragraph) - Zs (Separator, Space), except for the ASCII space `' '` `0x20` This allows for user-friendly inspection of strings that are not English (e.g. compare `"\u{e9}\u{e8}\u{ea}"` to `"éèê"`). Fixes #34318. CC #34422. [PEP 3138]: https://www.python.org/dev/peps/pep-3138/