about summary refs log tree commit diff
path: root/library/std/src/sys/unix/args.rs
AgeCommit message (Collapse)AuthorLines
2024-01-11std: begin moving platform support modules into `pal`joboet-282/+0
2023-12-03library: use c string literalsklensy-7/+9
2023-10-09Support AIX in Rust standard libraryQiu Chaofan-0/+1
2023-09-21added support for GNU/HurdSamuel Thibault-0/+1
2023-07-05Revert "use c literals in library"León Orell Valerian Liehr-6/+6
This reverts commit f212ba6d6d60963c8101bb24fc3e53fca80c046f.
2023-07-05Revert "fix ptr cast"León Orell Valerian Liehr-9/+7
This reverts commit 2f459f7f140307b5abbb7ea81440ed1843b490e7.
2023-06-21wip: Support Apple tvOS in libstdThom Chiovoloni-2/+2
2023-06-02fix ptr castklensy-7/+9
2023-05-31use c literals in libraryklensy-6/+6
2023-05-07PS Vita std supportNikolay Arhipov-1/+1
2023-02-28Add QNX Neutrino support to libstdFlorian Bartels-1/+2
Co-authored-by: gh-tr <troach@qnx.com>
2022-12-23Stop at the first `NULL` argument when iterating `argv`Sebastian Dröge-6/+22
Some C commandline parsers (e.g. GLib and Qt) are replacing already handled arguments in `argv` with `NULL` and move them to the end. That means that `argc` might be bigger than the actual number of non-`NULL` pointers in `argv` at this point. To handle this we simply stop iterating at the first `NULL` argument. `argv` is also guaranteed to be `NULL`-terminated so any non-`NULL` arguments after the first `NULL` can safely be ignored. Fixes https://github.com/rust-lang/rust/issues/105999
2022-07-20Library changes for Apple WatchOSVladimir Michael Eatwell-2/+2
2022-06-13Enable argv support for horizon OSIan Chamberlain-1/+2
See https://github.com/Meziu/rust-horizon/pull/9
2021-08-10STD support for the ESP-IDF frameworkivmarkov-0/+12
2021-07-19Add comments explaining the unix command-line argument support.Dan Gohman-2/+16
Following up on #87236, add comments to the unix command-line argument support explaining that the code doesn't mutate the system-provided argc/argv, and that this is why the code doesn't need a lock or special memory ordering.
2021-07-17x.py fmtDan Gohman-5/+1
2021-07-17Remove an unnecessary `Mutex` around argument initialization.Dan Gohman-8/+7
In the command-line argument initialization code, remove the Mutex around the `ARGV` and `ARGC` variables, and simply check whether ARGV is non-null before dereferencing it. This way, if either of ARGV or ARGC is not initialized, we'll get an empty argument list. This allows simple cdylibs to avoid having `pthread_mutex_lock`/`pthread_mutex_unlock` appear in their symbol tables if they don't otherwise use threads.
2021-07-17Remove args cleanup code.Dan Gohman-13/+0
As of 91c3eee1735ad72b579f99cbb6919c3471747d94, the global ARGC and ARGV no longer reference dynamically-allocated memory, so they don't need to be cleaned up.
2021-04-23Explicitly implement `!Send` and `!Sync` for `sys::{Args, Env}`Christiaan Dirkx-7/+6
2021-04-22Remove `sys::args::Args::inner_debug` and use `Debug` insteadChristiaan Dirkx-3/+4
2020-10-16Take sys/vxworks/args from sys/unix instead.Mara Bos-1/+2
2020-09-27Split sys_common::Mutex in StaticMutex and MovableMutex.Mara Bos-2/+2
The (unsafe) Mutex from sys_common had a rather complicated interface. You were supposed to call init() manually, unless you could guarantee it was neither moved nor used reentrantly. Calling `destroy()` was also optional, although it was unclear if 1) resources might be leaked or not, and 2) if destroy() should only be called when `init()` was called. This allowed for a number of interesting (confusing?) different ways to use this Mutex, all captured in a single type. In practice, this type was only ever used in two ways: 1. As a static variable. In this case, neither init() nor destroy() are called. The variable is never moved, and it is never used reentrantly. It is only ever locked using the LockGuard, never with raw_lock. 2. As a Boxed variable. In this case, both init() and destroy() are called, it will be moved and possibly used reentrantly. No other combinations are used anywhere in `std`. This change simplifies things by splitting this Mutex type into two types matching the two use cases: StaticMutex and MovableMutex. The interface of both new types is now both safer and simpler. The first one does not call nor expose init/destroy, and the second one calls those automatically in its new() and Drop functions. Also, the locking functions of MovableMutex are no longer unsafe.
2020-07-27mv std libs to library/mark-0/+251