about summary refs log tree commit diff
path: root/src/libstd/sys/unix
AgeCommit message (Collapse)AuthorLines
2019-11-24Return Ok(()) in docstrings in std::os::unix::netEmmanuel Gil Peyrot-10/+45
2019-11-24Replace .unwrap() with ? in std::os::unix::netEmmanuel Gil Peyrot-149/+237
2019-11-22Make std::sys::unix::args::init a no-op on glibc Linuxleo60228-2/+8
2019-11-22Document ARGV_INIT_ARRAYleo60228-0/+2
2019-11-22Set .init_array priorityleo60228-1/+1
I'm not entirely sure *why*, but this fixed a problem I was having.
2019-11-22Use .init_array section on glibcleo60228-0/+20
2019-11-20Rollup merge of #66553 - hermitcore:hermit, r=rkruppeMazdak Farrokhzad-1/+1
remove HermitCore leftovers from sys/unix HermitCore support is already moved to the directory "sys/hermit". => remove leftovers
2019-11-19HermitCore support is moved to sys/hermit, remove obsolete statement in sys/unixStefan Lankes-1/+1
2019-11-19Add unix::process::CommandExt::arg0Jeremy Fitzhardinge-10/+35
This allows argv[0] to be overridden on the executable's command-line. This also makes the program executed independent of argv[0]. Does Fuchsia have the same semantics? Addresses: #66510
2019-11-06rename cfg(rustdoc) into cfg(doc)Guillaume Gomez-15/+15
2019-11-06Rollup merge of #66092 - niacat:master, r=nagisaMazdak Farrokhzad-1/+2
Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD. This system call is present on all supported NetBSD versions and provides an endless stream of non-blocking random data from the kernel's ChaCha20-based CSPRNG. It doesn't require a file like `/dev/urandom` to be opened. The system call is documented here (under kern.arandom): https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-7.0 And defined here: https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#273 The semantics are the same as FreeBSD so reading 256 bytes per call is fine. Similar change for getrandom crate: rust-random/getrandom#115
2019-11-04Use any() in code shared between FreeBSD and NetBSDnia-1/+1
2019-11-04Use KERN_ARND syscall for random numbers on NetBSD, same as FreeBSD.nia-1/+2
This system call is present on all supported NetBSD versions and provides an endless stream of non-blocking random data from the kernel's ChaCha20-based CSPRNG. It doesn't require a file descriptor to be opened. The system call is documented here (under kern.arandom): https://netbsd.gw.com/cgi-bin/man-cgi?sysctl+7+NetBSD-7.0 And defined here: https://nxr.netbsd.org/xref/src/sys/sys/sysctl.h#273 The semantics are the same as FreeBSD so reading 256 bytes per call is fine. Similar change for getrandom crate: rust-random/getrandom#115
2019-10-28[doc] fix the reference to using `OpenOptions::open`Josh Stone-1/+1
2019-10-28[doc] add a possessive apostrophe in `OpenOptionsExt::mode`Josh Stone-1/+1
2019-10-26Auto merge of #65167 - hermitcore:rusty-hermit, r=alexcrichtonbors-30/+8
Redesign the interface to the unikernel HermitCore We are developing the unikernel HermitCore, where the kernel is written in Rust and is already part of the Rust Standard Library. The interface between the standard library and the kernel based on a small C library. With this pull request, we remove completely the dependency to C and use lld as linker. Currently, the kernel will be linked to the application as static library, which is published at https://github.com/hermitcore/libhermit-rs. We don’t longer support the C interface to the kernel. Consequently, we remove this part from the Rust Standard Library.
2019-10-25Rollup merge of #65685 - oxalica:statx-eperm, r=alexcrichtonMazdak Farrokhzad-42/+55
Fix check of `statx` and handle EPERM Should fix #65662 https://github.com/rust-lang/rust/issues/65662#issuecomment-544593939 > I think a reasonable solution might be to do something like try to stat AT_CWD initially and if that fails with EPERM or ENOSYS we disable the syscall entirely, otherwise it's cached as always good to use. r? @alexcrichton
2019-10-25Merge branch 'master' into rusty-hermit, resolve conflictsStefan Lankes-1/+1
2019-10-23Some tweaksoxalica-49/+44
2019-10-22Apply clippy::needless_return suggestionsMateusz Mikuła-1/+1
2019-10-22Merge branch 'master' into rusty-hermitStefan Lankes-34/+2
2019-10-22Fix check of `statx`oxalica-16/+34
2019-10-20Merge branch 'master' into rusty-hermitStefan Lankes-10/+217
2019-10-20Auto merge of #65469 - mati865:libc, r=alexcrichtonbors-34/+2
Update libc to 0.2.64 Passed local tests. cc potentially interested people: @gnzlbg @tlively
2019-10-18Fix cast of stx_btime.tv_nsecoxalica-1/+1
2019-10-18Fix cfgs for current libcoxalica-89/+139
2019-10-18Prefer statx on linux if availableoxalica-7/+164
2019-10-17Update emscripten functions declarationsMateusz Mikuła-34/+2
2019-10-16Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-1/+2
- Compatible with Emscripten 1.38.46-upstream or later upstream. - Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the old incorrect wasm32 C call ABI with the correct one, preserving the old one as wasm32_bindgen_compat for wasm-bindgen compatibility. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-30/+8
- 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-10-05Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, ↵Tyler Mandry-2/+1
r=alexcrichton" This reverts commit 7870050796e5904a0fc85ecbe6fa6dde1cfe0c91, reversing changes made to 2e7244807a7878f6eca3eb7d97ae9b413aa49014.
2019-10-04Upgrade Emscripten targets to use upstream LLVM backendThomas Lively-1/+2
- Refactors the Emscripten target spec to share code with other wasm targets. - Replaces the incorrect wasm32 C call ABI with the old asmjs version, which is correct for both wasm32 and JS. - Updates the varargs ABI used by Emscripten and deletes the old one. - Removes the obsolete wasm32-experimental-emscripten target. - Temporarily makes Emscripten targets use panic=abort by default because supporting unwinding will require an LLVM patch.
2019-09-25Fix ExitStatus on FuchsiaTyler Mandry-75/+93
Fuchsia exit codes don't follow the convention of libc::WEXITSTATUS et al, and they are 64 bits instead of 32 bits. This gives Fuchsia its own representation of ExitStatus. Additionally, the zircon syscall structs were out of date, causing us to see bogus return codes.
2019-09-07Rollup merge of #64023 - tmandry:libstd-fuchsia-fixes, r=cramertjMazdak Farrokhzad-27/+76
libstd fuchsia fixes This fixes two bugs in libstd on Fuchsia: - `zx_time_t` was changed to an `i64`, but this never made it into libstd - When spawning processes where any of the stdio were null, libstd attempts to open `/dev/null`, which doesn't exist on Fuchsia r? @cramertj
2019-09-06Rollup merge of #64198 - cramertj:fuchsia-monotonic, r=alexcrichtonMazdak Farrokhzad-0/+1
Add Fuchsia to actually_monotonic Fuchsia provides a fully monotonic clock. Fix https://github.com/rust-lang/rust/issues/64196 cc @joshlf @tmandry r? @alexcrichton
2019-09-05Add Fuchsia to actually_monotonicTaylor Cramer-0/+1
Fuchsia provides a fully monotonic clock.
2019-09-05std: Improve downstream codegen in `Command::env`Alex Crichton-4/+5
This commit rejiggers the generics used in the implementation of `Command::env` with the purpose of reducing the amount of codegen that needs to happen in consumer crates, instead preferring to generate code into libstd. This was found when profiling the compile times of the `cc` crate where the binary rlib produced had a lot of `BTreeMap` code compiled into it but the crate doesn't actually use `BTreeMap`. It turns out that `Command::env` is generic enough to codegen the entire implementation in calling crates, but in this case there's no performance concern so it's fine to compile the code into the standard library. This change is done by removing the generic on the `CommandEnv` map which is intended to handle case-insensitive variables on Windows. Instead now a generic isn't used but rather a `use` statement defined per-platform is used. With this commit a debug build of `Command::new("foo").env("a", "b")` drops from 21k lines of LLVM IR to 10k.
2019-08-30fuchsia: Fix default environment behavior when spawningTyler Mandry-2/+5
2019-08-30fuchsia: Don't fail to spawn if no stdin existsTyler Mandry-22/+41
2019-08-30Don't try to use /dev/null on FuchsiaTyler Mandry-9/+36
2019-08-29Update zx_time_t to an i64Tyler Mandry-3/+3
2019-08-23Auto merge of #63521 - newpavlov:redox_builder, r=pietroalbinibors-13/+12
Re-enable Redox builder (take 2) Closes: #63160
2019-08-19Consolidate sigemptyset workaroundsJoe Richey-40/+27
In sys/unix/process, we work around the sigemptyset linking issues on android in two different ways. This change consolidates these workarounds, and avoids duplicating bindings from `libc`.
2019-08-19remove any from cfgsArtyom Pavlov-2/+2
2019-08-19cfg fix 2Artyom Pavlov-1/+2
2019-08-19fix cfgArtyom Pavlov-11/+9
2019-08-08Rollup merge of #63332 - marmistrz:truncate, r=alexcrichtonMazdak Farrokhzad-3/+9
Add an overflow check in truncate implementation for Unix. Closes #63326. cc @alexcrichton
2019-08-08Move the TryInto import into the inner scopeMarcin Mielniczuk-1/+1
2019-08-06Fix cfg_if usageJeremy Soller-2/+2
2019-08-06redox: convert to target_family unixJeremy Soller-32/+92