From b190462ddb90527b2356c532ac708091b6f8efcf Mon Sep 17 00:00:00 2001 From: David Carlier Date: Fri, 16 Aug 2024 21:38:13 +0100 Subject: [PATCH] adding aligned_alloc support for unixes. close #3689 (backport ) (cherry picked from commit f136b309a9c6128ffe7ca6dec7043b1f31a8e80e) --- libc-test/semver/unix.txt | 1 + src/unix/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt index 6a18038c48ae3..093dde173137c 100644 --- a/libc-test/semver/unix.txt +++ b/libc-test/semver/unix.txt @@ -453,6 +453,7 @@ accept access addrinfo alarm +aligned_alloc atexit atof atoi diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 0a290b734a3d1..ebbf42d8140e2 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -940,6 +940,7 @@ extern "C" { pub fn pathconf(path: *const c_char, name: ::c_int) -> c_long; pub fn pipe(fds: *mut ::c_int) -> ::c_int; pub fn posix_memalign(memptr: *mut *mut ::c_void, align: ::size_t, size: ::size_t) -> ::c_int; + pub fn aligned_alloc(alignment: ::size_t, size: ::size_t) -> *mut ::c_void; #[cfg_attr( all(target_os = "macos", target_arch = "x86"), link_name = "read$UNIX2003"