From cb3999cd83a3fbfbd79aaeef3a295aff46c9ea14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Marie?= Date: Wed, 23 Dec 2015 11:24:11 +0100 Subject: [PATCH] switch from syscall(2) to getentropy(2) use the `getentropy()` function instead of `syscall()` and syscall-numbers. --- src/libstd/rand/os.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/rand/os.rs b/src/libstd/rand/os.rs index 0ba0e01ce29..23a368a30a5 100644 --- a/src/libstd/rand/os.rs +++ b/src/libstd/rand/os.rs @@ -222,7 +222,7 @@ mod imp { // getentropy(2) permits a maximum buffer size of 256 bytes for s in v.chunks_mut(256) { let ret = unsafe { - libc::syscall(libc::NR_GETENTROPY, s.as_mut_ptr(), s.len()) + libc::getentropy(s.as_mut_ptr() as *mut libc::c_void, s.len()) }; if ret == -1 { panic!("unexpected getentropy error: {}", errno());