File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -702,6 +702,11 @@ pub struct ArgsOs { inner: sys::args::Args }
702
702
/// (such as `*` and `?`). On Windows this is not done, and such arguments are
703
703
/// passed as-is.
704
704
///
705
+ /// On glibc Linux, arguments are retrieved by placing a function in .init_array.
706
+ /// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension.
707
+ /// This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS
708
+ /// and Windows.
709
+ ///
705
710
/// # Panics
706
711
///
707
712
/// The returned iterator will panic during iteration if any argument to the
@@ -732,6 +737,11 @@ pub fn args() -> Args {
732
737
/// set to arbitrary text, and it may not even exist, so this property should
733
738
/// not be relied upon for security purposes.
734
739
///
740
+ /// On glibc Linux, arguments are retrieved by placing a function in .init_array.
741
+ /// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension.
742
+ /// This allows `std::env::args` to work even in a `cdylib` or `staticlib`, as it does on macOS
743
+ /// and Windows.
744
+ ///
735
745
/// # Examples
736
746
///
737
747
/// ```
You can’t perform that action at this time.
0 commit comments