about summary refs log tree commit diff
path: root/src/libstd/sys
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-06-22 16:50:42 +0800
committerGitHub <noreply@github.com>2018-06-22 16:50:42 +0800
commite920d21d78014c58d4bcec646aac2a6bd867408c (patch)
tree92c6d728f5382e81b36da945590eadeedf4ead4e /src/libstd/sys
parentaa3a6273af45019d4e60eeed9798db69840e26e4 (diff)
parent03a40b31a74d62923ab616bb64e24c7f90ef3daf (diff)
downloadrust-e920d21d78014c58d4bcec646aac2a6bd867408c.tar.gz
rust-e920d21d78014c58d4bcec646aac2a6bd867408c.zip
Rollup merge of #51637 - abarth:new_prng, r=cramertj
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')
-rw-r--r--src/libstd/sys/unix/rand.rs7
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)
             }