diff --git a/Cargo.toml b/Cargo.toml index 6c77315bea48..b0e278c1b54c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,6 +46,7 @@ shell-escape = "0.1.4" rustc-workspace-hack = "1.0.0" hex = "0.3.2" rand = "0.6.5" +libc = "0.2.51" [build-dependencies] vergen = "3" diff --git a/src/fn_call.rs b/src/fn_call.rs index ba610e8b230c..74352302f36e 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -216,8 +216,8 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<' // // `libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), GRND_NONBLOCK)` // is called if a `HashMap` is created the regular way. - match this.read_scalar(args[0])?.to_usize(this)? { - 318 | 511 => { + match this.read_scalar(args[0])?.to_usize(this)? as i64 { + libc::SYS_getrandom => { match this.machine.rng.as_ref() { Some(rng) => { let ptr = this.read_scalar(args[1])?.to_ptr()?;