summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Richey <joerichey@google.com>2019-06-13 15:02:07 -0700
committerJoe Richey <joerichey@google.com>2019-06-13 15:02:07 -0700
commit8bc89810c23125ca85142a441ac0b4a7f268eb95 (patch)
treeed6f6c9888be29eef456b51a4f2d441b212c910b
parente0ff1e68b9e34173e9c4c3217d1b0fc81a7d352d (diff)
downloadrust-libc-8bc89810c23125ca85142a441ac0b4a7f268eb95.tar.gz
Add getrandom() bindings on linux and android
Closes #659
-rw-r--r--src/unix/linux_like/android/mod.rs5
-rw-r--r--src/unix/linux_like/linux/mod.rs5
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! {