Skip to content

Commit

Permalink
Revert "use SecRandomCopyBytes on macOS in Miri"
Browse files Browse the repository at this point in the history
This reverts commit 54aefc6.
  • Loading branch information
RalfJung committed May 13, 2019
1 parent fe5f42c commit 4cf2379
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/libstd/sys/unix/rand.rs
Expand Up @@ -13,7 +13,6 @@ pub fn hashmap_random_keys() -> (u64, u64) {

#[cfg(all(unix,
not(target_os = "ios"),
not(all(target_os = "macos", miri)),
not(target_os = "openbsd"),
not(target_os = "freebsd"),
not(target_os = "fuchsia")))]
Expand Down Expand Up @@ -107,9 +106,7 @@ mod imp {
// once per thread in `hashmap_random_keys`. Therefore `SecRandomCopyBytes` is
// only used on iOS where direct access to `/dev/urandom` is blocked by the
// sandbox.
// HACK: However, we do use this when running in Miri on macOS; intercepting this is much
// easier than intercepting accesses to /dev/urandom.
#[cfg(any(target_os = "ios", all(target_os = "macos", miri)))]
#[cfg(target_os = "ios")]
mod imp {
use crate::io;
use crate::ptr;
Expand Down

0 comments on commit 4cf2379

Please sign in to comment.