diff options
| author | Sébastien Marie <semarie@users.noreply.github.com> | 2015-12-23 11:24:11 +0100 |
|---|---|---|
| committer | Sébastien Marie <semarie@users.noreply.github.com> | 2016-01-12 08:43:51 +0100 |
| commit | cb3999cd83a3fbfbd79aaeef3a295aff46c9ea14 (patch) | |
| tree | f29fd0b7ebe9013f010f918a6898b5c287f0db9d | |
| parent | dedaebd5a16a053a8f2926d8b48de1a53ab08c4c (diff) | |
| download | rust-cb3999cd83a3fbfbd79aaeef3a295aff46c9ea14.tar.gz rust-cb3999cd83a3fbfbd79aaeef3a295aff46c9ea14.zip | |
switch from syscall(2) to getentropy(2)
use the `getentropy()` function instead of `syscall()` and syscall-numbers.
| -rw-r--r-- | src/libstd/rand/os.rs | 2 |
1 files changed, 1 insertions, 1 deletions
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()); |
