Use getrandom() syscall number from libc
This commit is contained in:
parent
312f938e79
commit
dddeda7f7d
2 changed files with 3 additions and 2 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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()?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue