File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 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 }
702702/// (such as `*` and `?`). On Windows this is not done, and such arguments are
703703/// passed as-is.
704704///
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+ ///
705710/// # Panics
706711///
707712/// The returned iterator will panic during iteration if any argument to the
@@ -732,6 +737,11 @@ pub fn args() -> Args {
732737/// set to arbitrary text, and it may not even exist, so this property should
733738/// not be relied upon for security purposes.
734739///
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+ ///
735745/// # Examples
736746///
737747/// ```
You can’t perform that action at this time.
0 commit comments