Skip to content

Commit 67eabc6

Browse files
author
Jethro Beekman
committed
SGX target: Expose thread id function in os module
1 parent f22dca0 commit 67eabc6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/libstd/os/fortanix_sgx/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,8 @@ pub mod mem {
4343
}
4444

4545
pub use crate::sys::ext::{io, arch, ffi};
46+
47+
/// Functions for querying thread-related information.
48+
pub mod thread {
49+
pub use crate::sys::abi::thread::current;
50+
}

src/libstd/sys/sgx/abi/thread.rs

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use fortanix_sgx_abi::Tcs;
44
/// all currently running threads in the enclave, and it is guaranteed to be
55
/// constant for the lifetime of the thread. More specifically for SGX, there
66
/// is a one-to-one correspondence of the ID to the address of the TCS.
7+
#[unstable(feature = "sgx_platform", issue = "56975")]
78
pub fn current() -> Tcs {
89
extern "C" { fn get_tcs_addr() -> Tcs; }
910
unsafe { get_tcs_addr() }

0 commit comments

Comments
 (0)