]> git.lizzy.rs Git - rust.git/commitdiff
Use raw syscall numbers
authorAaron Hill <aa1ronham@gmail.com>
Mon, 8 Apr 2019 00:08:15 +0000 (20:08 -0400)
committerAaron Hill <aa1ronham@gmail.com>
Mon, 8 Apr 2019 00:09:53 +0000 (20:09 -0400)
Cargo.toml
src/fn_call.rs

index b0e278c1b54c00f72e4efe822b3795d100555b45..6c77315bea48b238cfe1512b8a405bc672f1f682 100644 (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"
index 74352302f36e184d13fe0d682b9ad48234bece0d..52f252da5cfa859070ad316665144cedc7381aa6 100644 (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()?;