about summary refs log tree commit diff
path: root/src/libstd/sys/unix
AgeCommit message (Collapse)AuthorLines
2017-10-06Add current_pid functionThayne McCombs-0/+4
Fixes #44971
2017-10-05replace libc::res_init with res_init_if_glibc_before_2_26Jack O'Connor-0/+83
The previous workaround for gibc's res_init bug is not thread-safe on other implementations of libc, and it can cause crashes. Use a runtime check to make sure we only call res_init when we need to, which is also when it's safe. See https://github.com/rust-lang/rust/issues/43592.
2017-10-05Remove nacl from libstdest31-29/+4
2017-10-04zircon: update some more zx and lp constantsJames Tucker-22/+16
* Use size_t where size_t is used, while it's not critical on our specifically supported architectures, this is more accurate. * Update HND_SPECIAL_COUNT to the correct value, and give it the size that enum is likely to be.
2017-10-04zircon: the type of zx_handle_t is now unsignedJames Tucker-1/+6
This is a kernel ABI change that landed today. I noticed some other ABI issues and have left a note to cleanup once they are better defined.
2017-09-24LP_CLONE_FDIO_ROOT is now LP_CLONE_FDIO_NAMESPACEJames Tucker-2/+2
2017-09-24Fixed casing issues.P.Y. Laligand-16/+16
2017-09-24The Magenta kernel is now called Zircon.P.Y. Laligand-134/+134
2017-09-17Remove st_mode maskTrevor Merrifield-3/+3
2017-09-15Retain suid/sgid/sticky bits in Metadata.permissionsTrevor Merrifield-3/+3
Most users would expect set_permissions(Metadata.permissions()) to be non-destructive. While we can't guarantee this, we can at least pass the needed info to chmod. Also update the PermissionsExt documentation to disambiguate what it contains, and to refer to the underlying value as `st_mode` rather than its type `mode_t`. Closes #44147
2017-09-14Auto merge of #43972 - TobiasSchaffner:std_clean, r=alexcrichtonbors-21/+504
Add the libstd-modifications needed for the L4Re target 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. Some uncommon characteristics had to be resolved: * L4Re has no network funktionality * L4Re has a maximum stacksize of 1Mb for threads * L4Re has no uid or gid Co-authored-by: Sebastian Humenda <sebastian.humenda@tu-dresden.de>
2017-09-13Move default stack min size to thread implementationsTobias Schaffner-2/+7
The default min stack size value is smaller on l4re and therefore this value has to be different depending on the platform.
2017-09-10Auto merge of #44220 - ↵bors-7/+15
kennytm:fix-44216-instance-plus-max-duration-should-panic, r=alexcrichton Properly detect overflow in Instance ± Duration. Fix #44216. Fix #42622 The computation `Instant::now() + Duration::from_secs(u64::max_value())` now panics. The call `receiver.recv_timeout(Duration::from_secs(u64::max_value()))`, which involves such time addition, will also panic. The reason #44216 arises is because of an unchecked cast from `u64` to `i64`, making the duration equivalent to -1 second. Note that the current implementation is over-conservative, since e.g. (-2⁶²) + (2⁶³) is perfectly fine for an `i64`, yet this is rejected because (2⁶³) overflows the `i64`.
2017-09-10Rollup merge of #44384 - alexcrichton:osx-segfault, r=estebankGuillaume Gomez-1/+2
std: Fix a segfault on OSX with backtraces Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-08Move the stack size value for L4Re to the min_stack_size functionSebastian Humenda-4/+0
2017-09-08Re-enable networking module fo rL4ReSebastian Humenda-1/+445
As suggested in the discussion of PR #43972, std should provide a uniform API to all platforms. Since there's no networking on L4Re, this now is a module in `sys::net` providing types and functions/methods returning an error for each action.
2017-09-08Add modifications needed for L4re in libstdTobias Schaffner-8/+42
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-09-08Match c_char definitions and enable signal reset for L4ReSebastian Humenda-13/+17
* Match definition of c_char in os/raw.rs with the libc definition Due to historic reasons, os/raw.rs redefines types for c_char from libc, but these didn't match. Now they do :). * Enable signal reset on exec for L4Re L4Re has full signal emulation and hence it needs to reset the signal set of the child with sigemptyset. However, gid and uid should *not* be set.
2017-09-07Properly detect overflow in Instance +/- Duration.kennytm-7/+15
Avoid unchecked cast from `u64` to `i64`. Use `try_into()` for checked cast. (On Unix, cast to `time_t` instead of `i64`.)
2017-09-06std: Fix a segfault on OSX with backtracesAlex Crichton-1/+2
Apparently `dladdr` can succeed but still give you NULL pointers! Closes #44379
2017-09-02Fallback to dladdr-based resolve_symbol if backtrace failed.kennytm-14/+29
This programs compiled without -g on macOS still provide the resolve to actual symbols, instead of `<unknown>` everywhere.
2017-09-02Use env::current_exe for libbacktrace on macOSJohn Colanduoni-20/+7
2017-09-02Add libbacktrace support for Apple platformsJohn Colanduoni-5/+30
2017-08-28Update the libc submoduleAlex Crichton-8/+27
Brings in a few fixes for wasm/asmjs
2017-08-27Move unused-extern-crate to late passTatsuyuki Ishi-2/+0
2017-08-27Auto merge of #44112 - alexcrichton:thread-join, r=sfacklerbors-1/+2
std: Handle OS errors when joining threads Also add to the documentation that the `join` method can panic. cc #34971 cc #43539
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-08-24Fix inconsistent doc headingslukaramu-1/+1
This fixes headings reading "Unsafety" and "Example", they should be "Safety" and "Examples" according to RFC 1574.
2017-08-18Auto merge of #43900 - TobiasSchaffner:net_out_of_io, r=alexcrichtonbors-59/+62
Refactoring: move net specific file descriptor methods Move the implementations of net specific file descriptor methods from io to net. This makes it easier to exclude net at all if it is not needed for a target.
2017-08-17Rollup merge of #43891 - Fourchaux:master, r=steveklabnikCorey Farwell-1/+1
Fix typos & us spellings Fixing some typos and non en-US spellings. (Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-16Refactoring: move net specific fd imps to netTobias Schaffner-59/+62
Move the implementations of net specific file descriptior implementations to net. This makes it easier to exclude net at all if not needed for a target.
2017-08-16Auto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, ↵bors-1/+7
r=QuietMisdreavus Clarify writable behavior of readonly-named `Permissions` methods. Opened primarily to fix https://github.com/rust-lang/rust/issues/41984.
2017-08-15use field init shorthand EVERYWHEREZack M. Davis-7/+7
Like #43008 (f668999), but _much more aggressive_.
2017-08-15Fix typos & us spellingsFourchaux-1/+1
2017-08-15Add comments clarifying behavior of unix `set_readonly` behavior.Corey Farwell-1/+7
2017-08-13Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkovGuillaume Gomez-4/+4
Fix some typos Follow up of #43794 If refined my script a little bit and found some more.
2017-08-13Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichtonbors-14/+27
Expose all OS-specific modules in libstd doc. 1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc. 2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness. 3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed. Fixes #24658 (Does _not_ fully implement #1998).
2017-08-12Fix some typosBastien Orivel-4/+4
2017-08-12Fix error during cross-platform documentation.kennytm-0/+11
2017-08-11Rollup merge of #43783 - prisme60:prisme60-typo, r=Mark-SimulacrumGuillaume Gomez-1/+1
Fix typo corersponding -> corresponding I was reading the documentation of __Struct std::os::unix::net::UnixListener__ when I saw a typo inside.
2017-08-10Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1bors-2/+2
Fixed mutable vars being marked used when they weren't #### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue. Fixes #43526, Fixes #30280, Fixes #25049 ### Issue Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings ``` fn do_thing<T>(mut arg : &mut T) { ... // don't touch arg - just deref it to access the T } ``` ### Fix Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables. #### Why not on things other than local variables? * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted. * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.
2017-08-10Fix typo corersponding -> correspondingFoucher-1/+1
2017-08-10Exposed all platform-specific documentation.kennytm-14/+16
2017-08-04Auto merge of #43634 - dhduvall:solaris-test-fixes, r=sanxiynbors-6/+1
Fix a number of failing tests on Solaris and SPARC
2017-08-04Auto merge of #43459 - ids1024:asrawfd, r=alexcrichtonbors-0/+17
Implement AsRawFd for Stdin, Stdout, and Stderr https://github.com/rust-lang/rfcs/issues/2074
2017-08-03Fix a dangling symlink bug in `remove_dir_all()` on SolarisDanek Duvall-6/+1
This fixes a handful of long-failing tests.
2017-08-01Fixed all unnecessary muts in language coreIsaac van Bakel-2/+2
2017-07-25Correct 'stable' attributeIan Douglas Scott-3/+3
2017-07-24Add a disabled builder for aarch64 emulated testsAlex Crichton-0/+1
This commit adds a disabled builder which will run all tests for the standard library for aarch64 in a QEMU instance. Once we get enough capacity to run this on Travis this can be used to boost our platform coverage of AArch64
2017-07-24Implement AsRawFd for Stdin, Stdout, and StderrIan Douglas Scott-0/+17