about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorleo60228 <iakornfeld@gmail.com>2019-11-21 11:47:01 -0500
committerleo60228 <iakornfeld@gmail.com>2019-11-22 12:27:07 -0500
commite282b2227f4dac70bf805c59fc4c90e5a4e2c0ef (patch)
tree378b7985e1a5dd1faaef5a31764215aaaf68052a /src/libstd/sys
parent1ff055d875d0a3b19e0567a7e1cc6a2ee1a7921a (diff)
downloadrust-e282b2227f4dac70bf805c59fc4c90e5a4e2c0ef.tar.gz
rust-e282b2227f4dac70bf805c59fc4c90e5a4e2c0ef.zip
Document ARGV_INIT_ARRAY
Diffstat (limited to 'src/libstd/sys')
-rw-r--r--src/libstd/sys/unix/args.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/args.rs b/src/libstd/sys/unix/args.rs
index 209c5c542bc..58fa305a819 100644
--- a/src/libstd/sys/unix/args.rs
+++ b/src/libstd/sys/unix/args.rs
@@ -78,6 +78,8 @@ mod imp {
         ARGV = argv;
     }
 
+    /// glibc passes argc, argv, and envp to functions in .init_array, as a non-standard extension.
+    /// This allows `std::env::args` to work even in a `cdylib`, as it does on macOS and Windows.
     #[cfg(all(target_os = "linux", target_env = "gnu"))]
     #[used]
     #[link_section = ".init_array.00099"]