We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d6ff15 commit d8b6be9Copy full SHA for d8b6be9
src/libstd/sys/unix/args.rs
@@ -78,6 +78,26 @@ mod imp {
78
ARGV = argv;
79
}
80
81
+ #[cfg(all(target_os = "linux", target_env = "gnu"))]
82
+ #[used]
83
+ #[link_section = ".init_array"]
84
+ static ARGV_INIT_ARRAY: extern "C" fn(
85
+ crate::os::raw::c_int,
86
+ *const *const u8,
87
88
+ ) = {
89
+ extern "C" fn init_wrapper(
90
+ argc: crate::os::raw::c_int,
91
+ argv: *const *const u8,
92
+ _envp: *const *const u8,
93
+ ) {
94
+ unsafe {
95
+ init(argc as isize, argv);
96
+ }
97
98
+ init_wrapper
99
+ };
100
+
101
pub unsafe fn cleanup() {
102
let _guard = LOCK.lock();
103
ARGC = 0;
0 commit comments