From 93a3c59a473cb57224399550b4a75e65e69070f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20Neusch=C3=A4fer?= Date: Wed, 16 Oct 2024 09:05:59 +0200 Subject: [PATCH] Enable statx on musl-libc Version 1.2.5 of musl-libc added support for the statx system call[1]. [1]: https://musl.libc.org/releases.html --- ci/install-musl.sh | 2 +- src/unix/linux_like/mod.rs | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ci/install-musl.sh b/ci/install-musl.sh index 1cf1ec6500cde..1a4819b55c2d2 100755 --- a/ci/install-musl.sh +++ b/ci/install-musl.sh @@ -5,7 +5,7 @@ set -eux -musl_version=1.1.24 +musl_version=1.2.5 musl="musl-${musl_version}" # Download, configure, build, and install musl: diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 03461ff097091..26e78442f0951 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -206,7 +206,11 @@ s! { } cfg_if! { - if #[cfg(any(target_env = "gnu", target_os = "android"))] { + if #[cfg(any( + target_env = "gnu", + target_os = "android", + target_env = "musl" + ))] { s! { pub struct statx { pub stx_mask: ::__u32, @@ -1574,7 +1578,11 @@ cfg_if! { } cfg_if! { - if #[cfg(any(target_env = "gnu", target_os = "android"))] { + if #[cfg(any( + target_env = "gnu", + target_os = "android", + target_env = "musl" + ))] { pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000; pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000; pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000; @@ -1973,7 +1981,11 @@ cfg_if! { // The statx syscall, available on some libcs. cfg_if! { - if #[cfg(any(target_env = "gnu", target_os = "android"))] { + if #[cfg(any( + target_env = "gnu", + target_os = "android", + target_env = "musl" + ))] { extern "C" { pub fn statx( dirfd: ::c_int,