]> git.lizzy.rs Git - rust.git/blobdiff - library/std/src/sys/sgx/mod.rs
Document that `init` and `cleanup` are not guaranteed to run
[rust.git] / library / std / src / sys / sgx / mod.rs
index 9681336631fb879c91cc1744918e4e56bb71e397..059d6cb5ba13122994c69ee86439d1be1fe1181a 100644 (file)
@@ -32,7 +32,6 @@
 #[path = "../unsupported/process.rs"]
 pub mod process;
 pub mod rwlock;
-pub mod stack_overflow;
 pub mod stdio;
 pub mod thread;
 pub mod thread_local_key;
 pub use crate::sys_common::os_str_bytes as os_str;
 
 // SAFETY: must be called only once during runtime initialization.
-pub unsafe fn init() {}
+// NOTE: this is not guaranteed to run, for example when Rust code is called externally.
+pub unsafe fn init(argc: isize, argv: *const *const u8) {
+    unsafe {
+        args::init(argc, argv);
+    }
+}
 
 // SAFETY: must be called only once during runtime cleanup.
+// NOTE: this is not guaranteed to run, for example when the program aborts.
 pub unsafe fn cleanup() {}
 
 /// This function is used to implement functionality that simply doesn't exist.