Skip to content

Commit 3e7bfab

Browse files
committed
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 df56226 commit 3e7bfab

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

ci/install-musl.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@
55

66
set -eux
77

8-
case ${1} in
9-
loongarch64)
10-
musl_version=1.2.5
11-
;;
12-
*)
13-
[ -n "${RUST_LIBC_UNSTABLE_MUSL_V1_2_3:-}" ] && musl_version=1.2.3 || musl_version=1.1.24
14-
;;
15-
esac
16-
8+
musl_version=1.2.5
179
musl="musl-${musl_version}"
1810

1911
# Download, configure, build, and install musl:

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+
target_env = "musl"
248+
))] {
245249
s! {
246250
pub struct statx {
247251
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+
target_env = "musl"
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;
@@ -2177,7 +2185,11 @@ cfg_if! {
21772185

21782186
// The statx syscall, available on some libcs.
21792187
cfg_if! {
2180-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
2188+
if #[cfg(any(
2189+
target_env = "gnu",
2190+
target_os = "android",
2191+
target_env = "musl"
2192+
))] {
21812193
extern "C" {
21822194
pub fn statx(
21832195
dirfd: c_int,

0 commit comments

Comments
 (0)