Skip to content

Commit cb3999c

Browse files
committed
switch from syscall(2) to getentropy(2)
use the `getentropy()` function instead of `syscall()` and syscall-numbers.
1 parent dedaebd commit cb3999c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libstd/rand/os.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ mod imp {
222222
// getentropy(2) permits a maximum buffer size of 256 bytes
223223
for s in v.chunks_mut(256) {
224224
let ret = unsafe {
225-
libc::syscall(libc::NR_GETENTROPY, s.as_mut_ptr(), s.len())
225+
libc::getentropy(s.as_mut_ptr() as *mut libc::c_void, s.len())
226226
};
227227
if ret == -1 {
228228
panic!("unexpected getentropy error: {}", errno());

0 commit comments

Comments
 (0)