Skip to content

Commit ad9a971

Browse files
committed
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 <[email protected]>
1 parent beb65e2 commit ad9a971

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util_libc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Weak {
139139
}
140140

141141
cfg_if! {
142-
if #[cfg(any(target_os = "linux", target_os = "emscripten"))] {
142+
if #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "emscripten"))] {
143143
use libc::open64 as open;
144144
} else {
145145
use libc::open;

0 commit comments

Comments
 (0)