Skip to content

Commit c6ed9b3

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 aab8d07 commit c6ed9b3

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

ci/install-musl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
set -eux
77

8-
musl_version=1.1.24
8+
musl_version=1.2.5
99
musl="musl-${musl_version}"
1010

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

src/unix/linux_like/mod.rs

+15-3
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,11 @@ s! {
206206
}
207207

208208
cfg_if! {
209-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
209+
if #[cfg(any(
210+
target_env = "gnu",
211+
target_os = "android",
212+
target_env = "musl"
213+
))] {
210214
s! {
211215
pub struct statx {
212216
pub stx_mask: ::__u32,
@@ -1574,7 +1578,11 @@ cfg_if! {
15741578
}
15751579

15761580
cfg_if! {
1577-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1581+
if #[cfg(any(
1582+
target_env = "gnu",
1583+
target_os = "android",
1584+
target_env = "musl"
1585+
))] {
15781586
pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
15791587
pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
15801588
pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
@@ -1973,7 +1981,11 @@ cfg_if! {
19731981

19741982
// The statx syscall, available on some libcs.
19751983
cfg_if! {
1976-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1984+
if #[cfg(any(
1985+
target_env = "gnu",
1986+
target_os = "android",
1987+
target_env = "musl"
1988+
))] {
19771989
extern "C" {
19781990
pub fn statx(
19791991
dirfd: ::c_int,

0 commit comments

Comments
 (0)