diff options
author | Joe Richey <joerichey@google.com> | 2019-06-13 15:02:07 -0700 |
---|---|---|
committer | Joe Richey <joerichey@google.com> | 2019-06-13 15:02:07 -0700 |
commit | 8bc89810c23125ca85142a441ac0b4a7f268eb95 (patch) | |
tree | ed6f6c9888be29eef456b51a4f2d441b212c910b | |
parent | e0ff1e68b9e34173e9c4c3217d1b0fc81a7d352d (diff) | |
download | rust-libc-8bc89810c23125ca85142a441ac0b4a7f268eb95.tar.gz |
Add getrandom() bindings on linux and android
Closes #659
-rw-r--r-- | src/unix/linux_like/android/mod.rs | 5 | ||||
-rw-r--r-- | src/unix/linux_like/linux/mod.rs | 5 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/unix/linux_like/android/mod.rs b/src/unix/linux_like/android/mod.rs index 2662262963..0890eecbf3 100644 --- a/src/unix/linux_like/android/mod.rs +++ b/src/unix/linux_like/android/mod.rs @@ -2195,6 +2195,11 @@ extern { pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int; + pub fn getrandom( + buf: *mut u8, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; } cfg_if! { diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs index 6d9c5e7257..d995004302 100644 --- a/src/unix/linux_like/linux/mod.rs +++ b/src/unix/linux_like/linux/mod.rs @@ -2666,6 +2666,11 @@ extern { pub fn inotify_add_watch(fd: ::c_int, path: *const ::c_char, mask: u32) -> ::c_int; + pub fn getrandom( + buf: *mut u8, + buflen: ::size_t, + flags: ::c_uint, + ) -> ::ssize_t; } cfg_if! { |