From 808b1496710b369ceeddc0ef833af12c663ef6e4 Mon Sep 17 00:00:00 2001 From: Aaron Hill Date: Sun, 7 Apr 2019 20:08:15 -0400 Subject: [PATCH] Use raw syscall numbers --- Cargo.toml | 1 - src/fn_call.rs | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index b0e278c1b54c..6c77315bea48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -46,7 +46,6 @@ 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 74352302f36e..52f252da5cfa 100644 --- a/src/fn_call.rs +++ b/src/fn_call.rs @@ -217,7 +217,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)? as i64 { - libc::SYS_getrandom => { + // SYS_getrandom on x86_64 and x86 respectively + 318 | 355 => { match this.machine.rng.as_ref() { Some(rng) => { let ptr = this.read_scalar(args[1])?.to_ptr()?;