From 6a9fa7002f1d94c5444b7eebf78e332a7230a73f 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 --- src/unix/linux_like/mod.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/unix/linux_like/mod.rs b/src/unix/linux_like/mod.rs index 0c68006f56c01..de29bba46e085 100644 --- a/src/unix/linux_like/mod.rs +++ b/src/unix/linux_like/mod.rs @@ -241,7 +241,11 @@ cfg_if! { } cfg_if! { - if #[cfg(any(target_env = "gnu", target_os = "android"))] { + if #[cfg(any( + target_env = "gnu", + target_os = "android", + all(target_env = "musl", musl_v1_2_3) + ))] { s! { pub struct statx { pub stx_mask: crate::__u32, @@ -1658,7 +1662,11 @@ cfg_if! { } cfg_if! { - if #[cfg(any(target_env = "gnu", target_os = "android"))] { + if #[cfg(any( + target_env = "gnu", + target_os = "android", + all(target_env = "musl", musl_v1_2_3) + ))] { 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; @@ -2168,7 +2176,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", + all(target_env = "musl", musl_v1_2_3) + ))] { extern "C" { pub fn statx( dirfd: c_int,