1
Fork 0

switch from syscall(2) to getentropy(2)

use the `getentropy()` function instead of `syscall()` and
syscall-numbers.
This commit is contained in:
Sébastien Marie 2015-12-23 11:24:11 +01:00
parent dedaebd5a1
commit cb3999cd83

View file

@ -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());