Skip to content

Commit ef3c046

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
1 parent 46337d0 commit ef3c046

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
@@ -241,7 +241,11 @@ cfg_if! {
241241
}
242242

243243
cfg_if! {
244-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
244+
if #[cfg(any(
245+
target_env = "gnu",
246+
target_os = "android",
247+
all(target_env = "musl", musl_v1_2_3)
248+
))] {
245249
s! {
246250
pub struct statx {
247251
pub stx_mask: crate::__u32,
@@ -1662,7 +1666,11 @@ cfg_if! {
16621666
}
16631667

16641668
cfg_if! {
1665-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1669+
if #[cfg(any(
1670+
target_env = "gnu",
1671+
target_os = "android",
1672+
all(target_env = "musl", musl_v1_2_3)
1673+
))] {
16661674
pub const AT_STATX_SYNC_TYPE: c_int = 0x6000;
16671675
pub const AT_STATX_SYNC_AS_STAT: c_int = 0x0000;
16681676
pub const AT_STATX_FORCE_SYNC: c_int = 0x2000;
@@ -2172,7 +2180,11 @@ cfg_if! {
21722180

21732181
// The statx syscall, available on some libcs.
21742182
cfg_if! {
2175-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
2183+
if #[cfg(any(
2184+
target_env = "gnu",
2185+
target_os = "android",
2186+
all(target_env = "musl", musl_v1_2_3)
2187+
))] {
21762188
extern "C" {
21772189
pub fn statx(
21782190
dirfd: c_int,

0 commit comments

Comments
 (0)