From ad9a971e83dfe92c0c6d792cbe6859f4a12f82c7 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 28 Dec 2022 21:44:17 -0800 Subject: [PATCH] Do not use open64 on linux with musl glibc is providing open64 and other lfs64 functions but musl aliases them to normal equivalents since off_t is always 64-bit on musl, therefore check for target env along when target OS is linux before using open64, this is more available. Latest Musl has made these namespace changes [1] [1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4 Signed-off-by: Khem Raj --- src/util_libc.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util_libc.rs b/src/util_libc.rs index 65207fc6..0f4c0e97 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -139,7 +139,7 @@ impl Weak { } cfg_if! { - if #[cfg(any(target_os = "linux", target_os = "emscripten"))] { + if #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "emscripten"))] { use libc::open64 as open; } else { use libc::open;