about summary refs log tree commit diff
path: root/src/libstd/rt.rs
diff options
context:
space:
mode:
authorTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-03-18 23:02:06 +0900
committerTatsuyuki Ishi <ishitatsuyuki@gmail.com>2018-03-19 11:41:28 +0900
commita185b56b7caca17c7aa9d6f702fe1b2209c82e4e (patch)
tree466100d0d7eae30a20d65f9b9ab2e6792cc864f2 /src/libstd/rt.rs
parent1bb89f1b3cf1e4b5fa83391872136251c0030c1e (diff)
downloadrust-a185b56b7caca17c7aa9d6f702fe1b2209c82e4e.tar.gz
rust-a185b56b7caca17c7aa9d6f702fe1b2209c82e4e.zip
Address review comments
Diffstat (limited to 'src/libstd/rt.rs')
-rw-r--r--src/libstd/rt.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libstd/rt.rs b/src/libstd/rt.rs
index e1392762a59..8f945470b7e 100644
--- a/src/libstd/rt.rs
+++ b/src/libstd/rt.rs
@@ -73,3 +73,18 @@ fn lang_start<T: ::process::Termination + 'static>
 {
     lang_start_internal(&move || main().report(), argc, argv)
 }
+
+/// Function used for reverting changes to the main stack before setrlimit().
+/// This is POSIX (non-Linux) specific and unlikely to be directly stabilized.
+#[unstable(feature = "rustc_stack_internals", issue = "0")]
+pub unsafe fn deinit_stack_guard() {
+    ::sys::thread::guard::deinit();
+}
+
+/// Function used for resetting the main stack guard address after setrlimit().
+/// This is POSIX specific and unlikely to be directly stabilized.
+#[unstable(feature = "rustc_stack_internals", issue = "0")]
+pub unsafe fn update_stack_guard() {
+    let main_guard = ::sys::thread::guard::init();
+    ::sys_common::thread_info::reset_guard(main_guard);
+}