Use raw syscall numbers

This commit is contained in:
Aaron Hill
2019-04-07 20:08:15 -04:00
parent dddeda7f7d
commit 808b149671
2 changed files with 2 additions and 2 deletions
-1
View File
@@ -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"
+2 -1
View File
@@ -217,7 +217,8 @@ fn emulate_foreign_item(
// `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()?;