about summary refs log tree commit diff
path: root/src/libstd/sys/unix/os.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27mv std libs to library/mark-674/+0
2020-07-22Move the pipe2 call behind a hard target `#[cfg]`Josh Stone-0/+1
2020-04-14Add illumos triplePatrick Mooney-2/+2
Co-Authored-By: Jason King <jason.brian.king@gmail.com> Co-Authored-By: Joshua M. Clulow <jmc@oxide.computer>
2020-01-10make use of pointer::is_nullLzu Tao-4/+6
2020-01-02Use drop instead of the toilet closure `|_| ()`Lzu Tao-2/+2
2019-12-24Deprecate Error::description for realDavid Tolnay-0/+1
`description` has been documented as soft-deprecated since 1.27.0 (17 months ago). There is no longer any reason to call it or implement it. This commit: - adds #[rustc_deprecated(since = "1.41.0")] to Error::description; - moves description (and cause, which is also deprecated) below the source and backtrace methods in the Error trait; - reduces documentation of description and cause to take up much less vertical real estate in rustdocs, while preserving the example that shows how to render errors without needing to call description; - removes the description function of all *currently unstable* Error impls in the standard library; - marks #[allow(deprecated)] the description function of all *stable* Error impls in the standard library; - replaces miscellaneous uses of description in example code and the compiler.
2019-12-24x.py fmt after previous deignoreMark Rousskov-132/+181
2019-10-06redesign of the interface to the unikernel HermitCoreStefan Lankes-2/+1
- 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-08-06Fix cfg_if usageJeremy Soller-1/+1
2019-08-06redox: convert to target_family unixJeremy Soller-8/+22
2019-05-13Remove bitrig support from rustMarcel Hellwig-3/+2
2019-03-31libstd: deny(elided_lifetimes_in_paths)Mazdak Farrokhzad-2/+2
2019-02-28libstd => 2018Taiki Endo-30/+31
2018-12-25Remove licensesMark Rousskov-10/+0
2018-12-21Properly report ENOSYS by modifying errnoAdrian Budau-1/+14
2018-12-05Avoid extra copy and syscall in std::env::current_exeJohn-John Tedro-5/+8
2018-11-14std: Synchronize access to global env during `exec`Alex Crichton-8/+12
This commit, after reverting #55359, applies a different fix for #46775 while also fixing #55775. The basic idea was to go back to pre-#55359 libstd, and then fix #46775 in a way that doesn't expose #55775. The issue described in #46775 boils down to two problems: * First, the global environment is reset during `exec` but, but if the `exec` call fails then the global environment was a dangling pointer into free'd memory as the block of memory was deallocated when `Command` is dropped. This is fixed in this commit by installing a `Drop` stack object which ensures that the `environ` pointer is preserved on a failing `exec`. * Second, the global environment was accessed in an unsynchronized fashion during `exec`. This was fixed by ensuring that the Rust-specific environment lock is acquired for these system-level operations. Thanks to Alex Gaynor for pioneering the solution here! Closes #55775 Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2018-08-27fix a typo: taget_env -> target_envJack O'Connor-0/+27
This typo was introduced in https://github.com/rust-lang/rust/pull/47334. A couple tests bitrotted as a result, so we fix those too, and move them to a more sensible place.
2018-08-09Don't panic on std::env::vars() when env in null.BurntPizza-5/+1
Fixes #53200
2018-08-08avoid using the word 'initialized' to talk about that non-reentrant-capable ↵Ralf Jung-1/+1
state of the mutex
2018-08-06actually, reentrant uninitialized mutex acquisition is outright UBRalf Jung-3/+2
2018-08-06clarify partially initialized Mutex issuesRalf Jung-0/+3
2018-07-30Add targets for HermitCore (https://hermitcore.org) to the Rust compiler and ↵Colin Finck-1/+2
port libstd to it. As a start, the port uses the simplest possible configuration (no jemalloc, abort on panic) and makes use of existing Unix-specific code wherever possible. It adds targets for x86_64 (current main HermitCore platform) and aarch64 (HermitCore platform under development). Together with the patches to "liblibc" and "llvm", this enables HermitCore applications to be written in Rust.
2018-07-23Change single char str patterns to charsljedrz-1/+1
2018-06-17libstd: add an RAII utility for sys_common::mutex::MutexNODA, Kai-17/+9
Signed-off-by: NODA, Kai <nodakai@gmail.com>
2018-03-02Move glibc version lookup handling to sys::os and add a simpler glibc_version()Bryan Drewery-0/+32
2017-12-22fix some errors in libstdMichael Hewson-1/+1
2017-11-30NetBSD: add sysctl backend for std::env::current_exeJonathan A. Kollasch-1/+28
Use the CTL_KERN.KERN_PROC_ARGS.-1.KERN_PROC_PATHNAME sysctl in preference over the /proc/curproc/exe symlink. Additionally, perform more validation of aformentioned symlink. Particularly on pre-8.x NetBSD this symlink will point to '/' when accurate information is unavailable.
2017-11-19Add process::parent_idSteven Fackler-0/+4
I have this as a Unix-only API since it seems like Windows doesn't have a similar API.
2017-10-26Rollup merge of #45059 - tmccombs:pid, r=alexcrichtonkennytm-0/+4
Add current_pid function Fixes #44971
2017-10-06Add current_pid functionThayne McCombs-0/+4
Fixes #44971
2017-10-05Remove nacl from libstdest31-2/+0
2017-09-08Add modifications needed for L4re in libstdTobias Schaffner-3/+6
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-05-17Improve the error management when /proc is not mountedSylvestre Ledru-1/+6
This PR does two things: * Triggers an error on GNU/Linux & Android when /proc/self/exe doesn't exist * Handle the error properly
2017-02-22Merge branch 'master' of https://github.com/rust-lang/rust into readdirRaph Levien-29/+9
2017-02-21Switch Fuchsia to readdir (instead of readdir_r)Raph Levien-1/+1
The readdir_r function is deprecated on newer Posix systems because of various problems, and not implemented at all for Fuchsia. There are already implementations using both, and this patch switches Fuchsia over to the readdir-based one. Fixes #40021 for Fuchsia, but that issue also contains discussion of what should happen for other Posix systems.
2017-02-15simplify home_dir by removing unnecessary getpwuid_r wrapperShawn Walker-Salas-18/+9
2017-02-15libstd needs update for pending libc changeShawn Walker-Salas-11/+0
Fixes #39868
2016-12-06Fix current_exe() on DragonFly (again)Michael Neumann-7/+2
This is a follow up on [this pull request][1]. Since DragonFly 4.6.1 ([this commit][2]), the "kern.proc.pathname" sysctl works correctly, i.e. it does not return paths including a ":" (see [here][3]). Use it and don't try to fix old versions of DragonFly! There are not many DragonFly installations out there that we can't control and no one is compiling Rust from source. If someone wants to run Rust on a pre-4.6.1 DragonFly system, the ports system should provide a patch. [1]: https://github.com/rust-lang/rust/pull/35494 [2]: https://gitweb.dragonflybsd.org/dragonfly.git/commit/726f7ca07e193db73635e9c4e24e40c96087d6d9 [3]: https://gist.github.com/mneumann/a2f6b6a0a03935b561d6185872a4b222
2016-10-22Add Fuchsia supportRaph Levien-1/+7
Adds support for the x86_64-unknown-fuchsia target, which covers the Fuchsia operating system.
2016-10-08Use less `size_t` casts in libstd since it's now defined as `usize`Tobias Bucher-10/+9
2016-10-02Move platform-specific arg handling to sys::argsBrian Anderson-120/+0
2016-09-25Add support for the Haiku operating system on x86 and x86_64 machinesNiels Sascha Reedijk-1/+46
* Hand rebased from Niels original work on 1.9.0
2016-08-27Clean code a bitGuillaume Gomez-12/+9
2016-08-24Use `#[prelude_import]` in `libstd`.Jeffrey Seyfried-1/+0
2016-08-10[emscripten] Disable code paths that don't work on emscriptenJan-Erik Rediger-2/+4
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-07Utilize `PhantomData` to enforce `!Sync` and `!Send` field.Corey Farwell-6/+7
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-07-27Auto merge of #33312 - Byron:double-ended-iterator-for-args, r=alexcrichtonbors-0/+4
DoubleEndedIterator for Args This PR implements the DoubleEndedIterator trait for the `std::env::Args[Os]` structure, as well as the internal implementations. It is primarily motivated by me, as I happened to implement a simple `reversor` program many times now, which so far had to use code like this: ```Rust for arg in std::env::args().skip(1).collect::<Vec<_>>().iter().rev() {} ``` ... even though I would have loved to do this instead: ```Rust for arg in std::env::args().skip(1).rev() {} ``` The latter is more natural, and I did not find a reason for not implementing it. After all, on every system, the number of arguments passed to the program are known at runtime. To my mind, it follows KISS, and does not try to be smart at all. Also, there are no unit-tests, primarily as I did not find any existing tests for the `Args` struct either. The windows implementation is basically a copy-pasted variant of the `next()` method implementation, and I could imagine sharing most of the code instead. Actually I would be happy if the reviewer would ask for it.