From 8924123c42e5fe9232f524129fd4e0d6f239b1d2 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 27 Sep 2024 22:01:43 +0000 Subject: [PATCH] arc4random api for haiku --- libc-test/build.rs | 1 + src/unix/haiku/mod.rs | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 743f9f28404db..07621d5927d8b 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -4795,6 +4795,7 @@ fn test_haiku(target: &str) { "libutil.h", "link.h", "pty.h", + "stdlib.h", "stringlist.h", "sys/link_elf.h", } diff --git a/src/unix/haiku/mod.rs b/src/unix/haiku/mod.rs index 4afbeedfc1f9a..47e4c4eb69aeb 100644 --- a/src/unix/haiku/mod.rs +++ b/src/unix/haiku/mod.rs @@ -2133,6 +2133,10 @@ extern "C" { >, data: *mut ::c_void, ) -> ::c_int; + + pub fn arc4random() -> u32; + pub fn arc4random_uniform(upper_bound: u32) -> u32; + pub fn arc4random_buf(buf: *mut ::c_void, n: ::size_t); } #[link(name = "gnu")]