diff options
| author | Adam Barth <abarth@google.com> | 2018-06-19 09:46:51 -0700 | 
|---|---|---|
| committer | Adam Barth <abarth@google.com> | 2018-06-19 09:46:51 -0700 | 
| commit | 03a40b31a74d62923ab616bb64e24c7f90ef3daf (patch) | |
| tree | 05b34d81087e42155d8691bc08307becb162a066 /src/libstd/sys/unix/rand.rs | |
| parent | a646c912f76412921b27b426a1da83e7df981dcc (diff) | |
| download | rust-03a40b31a74d62923ab616bb64e24c7f90ef3daf.tar.gz rust-03a40b31a74d62923ab616bb64e24c7f90ef3daf.zip | |
Update zx_cprng_draw_new on Fuchsia
Fuchsia is changing the semantics for zx_cprng_draw and zx_cprng_draw_new is a temporary name for the new semantics.
Diffstat (limited to 'src/libstd/sys/unix/rand.rs')
| -rw-r--r-- | src/libstd/sys/unix/rand.rs | 7 | 
1 files changed, 3 insertions, 4 deletions
| diff --git a/src/libstd/sys/unix/rand.rs b/src/libstd/sys/unix/rand.rs index caa18945765..3f7f0671490 100644 --- a/src/libstd/sys/unix/rand.rs +++ b/src/libstd/sys/unix/rand.rs @@ -183,15 +183,14 @@ mod imp { mod imp { #[link(name = "zircon")] extern { - fn zx_cprng_draw(buffer: *mut u8, len: usize, actual: *mut usize) -> i32; + fn zx_cprng_draw_new(buffer: *mut u8, len: usize) -> i32; } fn getrandom(buf: &mut [u8]) -> Result<usize, i32> { unsafe { - let mut actual = 0; - let status = zx_cprng_draw(buf.as_mut_ptr(), buf.len(), &mut actual); + let status = zx_cprng_draw_new(buf.as_mut_ptr(), buf.len()); if status == 0 { - Ok(actual) + Ok(buf.len()) } else { Err(status) } | 
