mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 22:18:23 +03:00
Use raw syscall numbers
This commit is contained in:
@@ -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
@@ -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()?;
|
||||
|
||||
Reference in New Issue
Block a user