From d78de298a8068ee242cf15aa8d0b9e3f3d70929f Mon Sep 17 00:00:00 2001 From: David CARLIER Date: Mon, 13 Nov 2023 18:30:46 +0000 Subject: [PATCH] adding getentropy for apple devices. --- libc-test/build.rs | 1 + libc-test/semver/apple.txt | 1 + src/unix/bsd/apple/mod.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index d2d822dd70a38..4460005b26b07 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -268,6 +268,7 @@ fn test_apple(target: &str) { "sys/proc_info.h", "sys/ptrace.h", "sys/quota.h", + "sys/random.h", "sys/resource.h", "sys/sem.h", "sys/shm.h", diff --git a/libc-test/semver/apple.txt b/libc-test/semver/apple.txt index ef911271ff425..1760483cbd51a 100644 --- a/libc-test/semver/apple.txt +++ b/libc-test/semver/apple.txt @@ -1915,6 +1915,7 @@ getattrlistbulk getdate getdomainname getdtablesize +getentropy getfsstat getgrent getgrgid diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs index 79c5641d47813..f12daceec85bf 100644 --- a/src/unix/bsd/apple/mod.rs +++ b/src/unix/bsd/apple/mod.rs @@ -6260,6 +6260,7 @@ extern "C" { pub fn sethostid(hostid: ::c_long); pub fn CCRandomGenerateBytes(bytes: *mut ::c_void, size: ::size_t) -> ::CCRNGStatus; + pub fn getentropy(buf: *mut ::c_void, buflen: ::size_t) -> ::c_int; pub fn _NSGetExecutablePath(buf: *mut ::c_char, bufsize: *mut u32) -> ::c_int; pub fn _NSGetEnviron() -> *mut *mut *mut ::c_char;