Skip to content

Commit d431cd2

Browse files
neuschaefertgross35
authored andcommitted
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 (backport <#3976>) (cherry picked from commit ef3c046)
1 parent 4fa238b commit d431cd2

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/unix/linux_like/mod.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,11 @@ cfg_if! {
234234
}
235235

236236
cfg_if! {
237-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
237+
if #[cfg(any(
238+
target_env = "gnu",
239+
target_os = "android",
240+
all(target_env = "musl", musl_v1_2_3)
241+
))] {
238242
s! {
239243
pub struct statx {
240244
pub stx_mask: crate::__u32,
@@ -1663,7 +1667,11 @@ cfg_if! {
16631667
}
16641668

16651669
cfg_if! {
1666-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1670+
if #[cfg(any(
1671+
target_env = "gnu",
1672+
target_os = "android",
1673+
all(target_env = "musl", musl_v1_2_3)
1674+
))] {
16671675
pub const AT_STATX_SYNC_TYPE: c_int = 0x6000;
16681676
pub const AT_STATX_SYNC_AS_STAT: c_int = 0x0000;
16691677
pub const AT_STATX_FORCE_SYNC: c_int = 0x2000;
@@ -2181,7 +2189,11 @@ cfg_if! {
21812189

21822190
// The statx syscall, available on some libcs.
21832191
cfg_if! {
2184-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
2192+
if #[cfg(any(
2193+
target_env = "gnu",
2194+
target_os = "android",
2195+
all(target_env = "musl", musl_v1_2_3)
2196+
))] {
21852197
extern "C" {
21862198
pub fn statx(
21872199
dirfd: c_int,

0 commit comments

Comments
 (0)