diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-16 17:08:56 -0700 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-16 17:08:56 -0700 | 
| commit | 41d956bf632fbc658f21a4195344fe79b685cde9 (patch) | |
| tree | 24b2fbdfb120b84814d6b1bd996e6dba940fd15e /src/libstd/sys/sgx/mod.rs | |
| parent | ec93d566b3ef29d5b97acca520558b5b05104f20 (diff) | |
| parent | 85c25aed510ce599504b172f7c7bef280e91637b (diff) | |
| download | rust-41d956bf632fbc658f21a4195344fe79b685cde9.tar.gz rust-41d956bf632fbc658f21a4195344fe79b685cde9.zip | |
Rollup merge of #73269 - mzohreva:mz/sgx-wait-timeout, r=jethrogb
Enable some timeouts in SGX platform This would partially resolve https://github.com/fortanix/rust-sgx/issues/31 cc @jethrogb and @Goirad
Diffstat (limited to 'src/libstd/sys/sgx/mod.rs')
| -rw-r--r-- | src/libstd/sys/sgx/mod.rs | 9 | 
1 files changed, 6 insertions, 3 deletions
| diff --git a/src/libstd/sys/sgx/mod.rs b/src/libstd/sys/sgx/mod.rs index a4968ff7d4f..1d32eb25424 100644 --- a/src/libstd/sys/sgx/mod.rs +++ b/src/libstd/sys/sgx/mod.rs @@ -137,8 +137,8 @@ pub extern "C" fn __rust_abort() { abort_internal(); } -pub fn hashmap_random_keys() -> (u64, u64) { - fn rdrand64() -> u64 { +pub mod rand { + pub fn rdrand64() -> u64 { unsafe { let mut ret: u64 = 0; for _ in 0..10 { @@ -149,7 +149,10 @@ pub fn hashmap_random_keys() -> (u64, u64) { rtabort!("Failed to obtain random data"); } } - (rdrand64(), rdrand64()) +} + +pub fn hashmap_random_keys() -> (u64, u64) { + (self::rand::rdrand64(), self::rand::rdrand64()) } pub use crate::sys_common::{AsInner, FromInner, IntoInner}; | 
