From 193ff54c9767a96b9c98298aff272e34448bb23f Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 28 Dec 2022 21:44:17 -0800 Subject: [PATCH] Use open instead of open64 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] There is no need for using LFS64 open explicitly as we are only using it for opening device files and not real files [1] https://git.musl-libc.org/cgit/musl/commit/?id=246f1c811448f37a44b41cd8df8d0ef9736d95f4 Signed-off-by: Khem Raj --- src/util_libc.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/util_libc.rs b/src/util_libc.rs index 63b060e7..a78c48da 100644 --- a/src/util_libc.rs +++ b/src/util_libc.rs @@ -141,11 +141,7 @@ impl Weak { } cfg_if! { - if #[cfg(any(target_os = "linux", target_os = "emscripten"))] { - use libc::open64 as open; - } else { - use libc::open; - } + use libc::open; } // SAFETY: path must be null terminated, FD must be manually closed.