Skip to content

Commit dddeda7

Browse files
committed
Use getrandom() syscall number from libc
1 parent 312f938 commit dddeda7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ shell-escape = "0.1.4"
4646
rustc-workspace-hack = "1.0.0"
4747
hex = "0.3.2"
4848
rand = "0.6.5"
49+
libc = "0.2.51"
4950

5051
[build-dependencies]
5152
vergen = "3"

src/fn_call.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ pub trait EvalContextExt<'a, 'mir, 'tcx: 'a + 'mir>: crate::MiriEvalContextExt<'
216216
//
217217
// `libc::syscall(NR_GETRANDOM, buf.as_mut_ptr(), buf.len(), GRND_NONBLOCK)`
218218
// is called if a `HashMap` is created the regular way.
219-
match this.read_scalar(args[0])?.to_usize(this)? {
220-
318 | 511 => {
219+
match this.read_scalar(args[0])?.to_usize(this)? as i64 {
220+
libc::SYS_getrandom => {
221221
match this.machine.rng.as_ref() {
222222
Some(rng) => {
223223
let ptr = this.read_scalar(args[1])?.to_ptr()?;

0 commit comments

Comments
 (0)