From f4150780462d20d709369743bbc7f7a9e26cb6ca Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Wed, 3 Aug 2022 22:22:31 -0400 Subject: [PATCH 1/2] Add `gnu_get_[version|release]` for glibc See and --- libc-test/build.rs | 1 + src/unix/linux_like/linux/gnu/mod.rs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/libc-test/build.rs b/libc-test/build.rs index 7797ec6c66fbf..946856fece0ff 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2675,6 +2675,7 @@ fn test_linux(target: &str) { "elf.h", "fcntl.h", "glob.h", + "gnu/libc-version.h", "grp.h", "iconv.h", "ifaddrs.h", diff --git a/src/unix/linux_like/linux/gnu/mod.rs b/src/unix/linux_like/linux/gnu/mod.rs index 64ca4156de512..9e8a88a58c04a 100644 --- a/src/unix/linux_like/linux/gnu/mod.rs +++ b/src/unix/linux_like/linux/gnu/mod.rs @@ -1326,6 +1326,11 @@ extern "C" { pub fn malloc_trim(__pad: ::size_t) -> ::c_int; } +extern "C" { + pub fn gnu_get_libc_release() -> *const ::c_char; + pub fn gnu_get_libc_version() -> *const ::c_char; +} + cfg_if! { if #[cfg(any(target_arch = "x86", target_arch = "arm", From f49efe43ad6063ff2ef030ee8601cb8ec2c2852b Mon Sep 17 00:00:00 2001 From: Christian Legnitto Date: Thu, 11 Aug 2022 10:35:17 +0200 Subject: [PATCH 2/2] Limit `gnu/libc-version.h` header to glibc --- libc-test/build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc-test/build.rs b/libc-test/build.rs index 946856fece0ff..3cc2c135f78ca 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -2675,7 +2675,7 @@ fn test_linux(target: &str) { "elf.h", "fcntl.h", "glob.h", - "gnu/libc-version.h", + [gnu]: "gnu/libc-version.h", "grp.h", "iconv.h", "ifaddrs.h",