about summary refs log tree commit diff
path: root/src/libstd/sys
AgeCommit message (Collapse)AuthorLines
2019-08-06redox: convert to target_family unixJeremy Soller-6423/+93
2019-08-06Add an overflow check in truncate implementation for Unix.Marcin Mielniczuk-3/+9
2019-08-03Add {IoSlice, IoSliceMut}::advanceThomas de Zeeuw-0/+152
2019-08-02Auto merge of #63228 - Centril:rollup-x39p5ga, r=Centrilbors-64/+0
Rollup of 7 pull requests Successful merges: - #63107 (Added support for armv7-unknown-linux-gnueabi/musleabi) - #63121 (On `format!()` arg count mismatch provide extra info) - #63196 (build_helper: try less confusing method names) - #63206 (remove unsupported test case) - #63208 (Round generator sizes to a multiple of their alignment) - #63212 (Pretty print attributes in `print_arg`) - #63215 (Clarify semantics of mem::zeroed) Failed merges: r? @ghost
2019-08-03Rollup merge of #63206 - BaoshanPang:master, r=alexcrichtonMazdak Farrokhzad-64/+0
remove unsupported test case r? @alexcrichton
2019-08-02Auto merge of #62309 - jlevon:62302, r=alexcrichtonbors-1/+14
provide thread name to OS for Solarish systems Fixes #62302 Passes a Linux bootstrap build. python x.py test src/tools/tidy happy. I tested this with a small test binary that spawns a few threads, and verified that: - on an illumos system lacking the libc function, the binary runs but no OS-level thread names are set - on an illumos system with the feature, the binary runs, and the thread names are visible and correct under tools like MDB, pstack, core dump, etc.
2019-08-02remove unsupported test caseBaoshan Pang-64/+0
2019-08-02provide thread name to OS for Solarish systemsJohn Levon-1/+14
2019-08-01Remove mach dependencygnzlbg-5/+21
2019-08-01Update libc and use the Mach kernel APIs via the mach crate instead.gnzlbg-4/+5
2019-07-31Fix UWP buildMartin Finkel-2/+2
2019-07-30Rollup merge of #63117 - BaoshanPang:bugfix, r=alexcrichtonMazdak Farrokhzad-14/+3
Use global variable 'environ' to pass environments to rtpSpawn r? @alexcrichton
2019-07-29use gloabl variable 'environ' to pass environments to rtpSpawnBaoshan Pang-14/+3
2019-07-28vxworks: Remove Linux-specific comments.Joe Richey-25/+1
2019-07-29Rollup merge of #62809 - alexcrichton:wasm-llvm-9, r=nikicMazdak Farrokhzad-129/+56
rustc: Update wasm32 support for LLVM 9 This commit brings in a number of minor updates for rustc's support for the wasm target which has changed in the LLVM 9 update. Notable updates include: * The compiler now no longer manually inserts the `producers` section, instead relying on LLVM to do so. LLVM uses the `llvm.ident` metadata for the `processed-by` directive (which is now emitted on the wasm target in this PR) and it uses debuginfo to figure out what `language` to put in the `producers` section. * Threaded WebAssembly code now requires different flags to be passed with LLD. In LLD we now pass: * `--shared-memory` - required since objects are compiled with atomics. This also means that the generated memory will be marked as `shared`. * `--max-memory=1GB` - required with the `--shared-memory` argument since shared memories in WebAssembly must have a maximum size. The 1GB number is intended to be a conservative estimate for rustc, but it should be overridable with `-C link-arg` if necessary. * `--passive-segments` - this has become the default for multithreaded memory, but when compiling a threaded module all data segments need to be marked as passive to ensure they don't re-initialize memory for each thread. This will also cause LLD to emit a synthetic function to initialize memory which users will have to arrange to call. * The `__heap_base` and `__data_end` globals are explicitly exported since they're now hidden by default due to the `--export` flags we pass to LLD.
2019-07-28Rollup merge of #62806 - mati865:clippy, r=TimNNMazdak Farrokhzad-2/+2
Fix few Clippy warnings
2019-07-27Rollup merge of #63013 - nivkner:ffi-safe-slice, r=sfacklerMazdak Farrokhzad-0/+3
add `repr(transparent)` to `IoSliceMut` where missing tried using `IoSliceMut` in FFI, got `improper_ctypes` warning. according to the docs: `IoSliceMut` is "guaranteed to be ABI compatible with the `iovec` type" so it should be usable in FFI. `IoSlice` is also `repr(transparent)` for every platform where these types contain `iovec`-like types. vxworks also has `IoSliceMut` as transparent so its not even consistently one or the other. no comment about this next to the types or in the PR that introduced the types, so assuming this was just missed. r? @sfackler
2019-07-26Rollup merge of #62980 - alexcrichton:windows-metadata, r=sfacklerMazdak Farrokhzad-16/+69
std: Add more accessors for `Metadata` on Windows This commit adds accessors for more fields in `fs::Metadata` on Windows which weren't previously exposed. There's two sources of `fs::Metadata` on Windows currently, one from `DirEntry` and one from a file itself. These two sources of information don't actually have the same set of fields exposed in their stat information, however. To handle this the platform-specific accessors of Windows-specific information all return `Option` to return `None` in the case a metadata comes from a `DirEntry`, but they're guaranteed to return `Some` if it comes from a file itself. This is motivated by some changes in CraneStation/wasi-common#42, and I'm curious how others feel about this platform-specific functionality!
2019-07-26Rollup merge of #62862 - BaoshanPang:cleanup, r=alexcrichtonMazdak Farrokhzad-1042/+1
code cleanup remove all codes that are not used by vxWorks
2019-07-26add repr(transparent) to IoSliceMut where missingNiv Kaminer-0/+3
2019-07-26std: Add more accessors for `Metadata` on WindowsAlex Crichton-16/+69
This commit adds accessors for more fields in `fs::Metadata` on Windows which weren't previously exposed. There's two sources of `fs::Metadata` on Windows currently, one from `DirEntry` and one from a file itself. These two sources of information don't actually have the same set of fields exposed in their stat information, however. To handle this the platform-specific accessors of Windows-specific information all return `Option` to return `None` in the case a metadata comes from a `DirEntry`, but they're guaranteed to return `Some` if it comes from a file itself. This is motivated by some changes in CraneStation/wasi-common#42, and I'm curious how others feel about this platform-specific functionality!
2019-07-25std: win: Disable stack overflow handling on UWPHugo Beauzée-Luyssen-29/+45
The required functions are not available, so hope for the best
2019-07-25std: win: Don't use console APIs on UWPHugo Beauzée-Luyssen-26/+119
2019-07-25std: win: Don't use GetFileInformationByHandle on UWPHugo Beauzée-Luyssen-19/+76
2019-07-25std: win: Don't use GetUserProfileDirectoryW on UWPHugo Beauzée-Luyssen-13/+26
2019-07-25std: win: Don't expose link() on UWPHugo Beauzée-Luyssen-4/+11
Or rather expose it, but always return an error
2019-07-25std: win: Don't use SetHandleInformation on UWPHugo Beauzée-Luyssen-19/+61
Attempt to create sockets with the WSA_FLAG_NO_HANDLE_INHERIT flag, and handle the potential error gracefully (as the flag isn't support on Windows 7 before SP1)
2019-07-25std: rand: Use BCrypt on UWPHugo Beauzée-Luyssen-2/+41
As Rtl* functions are not allowed there
2019-07-25libstd: windows: compat: Allow use of attributesHugo Beauzée-Luyssen-0/+2
2019-07-25std: Use native `#[thread_local]` TLS on wasmAlex Crichton-129/+56
This commit moves `thread_local!` on WebAssembly targets to using the `#[thread_local]` attribute in LLVM. This was recently implemented upstream and is [in the process of being documented][dox]. This change only takes affect if modules are compiled with `+atomics` which is currently unstable and a pretty esoteric method of compiling wasm artifacts. This "new power" of the wasm toolchain means that the old `wasm-bindgen-threads` feature of the standard library can be removed since it should now be possible to create a fully functioning threaded wasm module without intrusively dealing with libstd symbols or intrinsics. Yay! [dox]: https://github.com/WebAssembly/tool-conventions/pull/116
2019-07-23Use raw pointers in std::sys::cloudabi when passing MaybeUninit valuesNathan-6/+6
2019-07-23Cleanup std::sys::cloudabiNathan-19/+19
2019-07-23Modify CloudABI ReentrantMutex to use MaybeUninitNathan-14/+18
Remove uses of mem::uninitialized, which is now deprecated
2019-07-22Remove uses of mem::uninitialized in std::sys::cloudabiNathan-16/+30
Usages still appear in cloudabi tests and in the reentrant mutex implementation
2019-07-21code cleanupBaoshan Pang-1042/+1
2019-07-19warn about deprecated-in-future in most of libstdRalf Jung-1/+1
2019-07-18Fix clippy::len_zero warningsMateusz Mikuła-1/+1
2019-07-18Fix clippy::clone_on_copy warningsMateusz Mikuła-1/+1
2019-07-16Add supporting for vxWorksBaoshan Pang-1/+8265
r? @alexcrichton
2019-07-11Rollup merge of #62425 - cyphar:linux-cloexec-use-fcntl, r=alexcrichtonMazdak Farrokhzad-0/+2
filedesc: don't use ioctl(FIOCLEX) on Linux All `ioctl(2)`s will fail on `O_PATH` file descriptors on Linux (because they use `&empty_fops` as a security measure against `O_PATH` descriptors affecting the backing file). As a result, `File::try_clone()` and various other methods would always fail with `-EBADF` on `O_PATH` file descriptors. The solution is to simply use `F_SETFD` (as is used on other unices) which works on `O_PATH` descriptors because it operates through the `fnctl(2)` layer and not through `ioctl(2)`s. Since this code is usually only used in strange error paths (a broken or ancient kernel), the extra overhead of one syscall shouldn't cause any dramas. Most other systems programming languages also use the fnctl(2) so this brings us in line with them. Fixes: rust-lang/rust#62314 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2019-07-10filedesc: don't use ioctl(FIOCLEX) on LinuxAleksa Sarai-0/+2
All ioctl(2)s will fail on O_PATH file descriptors on Linux (because they use &empty_fops as a security measure against O_PATH descriptors affecting the backing file). As a result, File::try_clone() and various other methods would always fail with -EBADF on O_PATH file descriptors. The solution is to simply use F_SETFD (as is used on other unices) which works on O_PATH descriptors because it operates through the fnctl(2) layer and not through ioctl(2)s. Since this code is usually only used in strange error paths (a broken or ancient kernel), the extra overhead of one syscall shouldn't cause any dramas. Most other systems programming languages also use the fnctl(2) so this brings us in line with them. Fixes: rust-lang/rust#62314 Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2019-07-06Rollup merge of #62296 - RalfJung:memalign, r=alexcrichtonMazdak Farrokhzad-1/+9
request at least ptr-size alignment from posix_memalign Fixes https://github.com/rust-lang/rust/issues/62251
2019-07-05Remove last use of mem::uninitialized in SGXJethro Beekman-3/+1
2019-07-05Rollup merge of #62123 - jeremystucki:needless_lifetimes_std, r=alexcrichtonMazdak Farrokhzad-5/+5
Remove needless lifetimes (std) Split from #62039
2019-07-04Permit use of mem::uninitialized via allow(deprecated)Mark Rousskov-0/+4
2019-07-04Add missing lifetime specifierJeremy Stucki-1/+1
Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2019-07-03fix unused-import error on androidRalf Jung-2/+1
2019-07-02improve and deduplicate commentsRalf Jung-4/+3
2019-07-02request at least ptr-size alignment from posix_memalignRalf Jung-1/+11
2019-07-01Convert more usages overChris Gregory-1/+1