Skip to content

Commit

Permalink
switch from syscall(2) to getentropy(2)
Browse files Browse the repository at this point in the history
use the `getentropy()` function instead of `syscall()` and
syscall-numbers.
  • Loading branch information
semarie committed Jan 12, 2016
1 parent dedaebd commit cb3999c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/libstd/rand/os.rs
Expand Up @@ -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());
Expand Down

0 comments on commit cb3999c

Please sign in to comment.