Skip to content

Commit 60265ba

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 9e861d6 commit 60265ba

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
@@ -213,7 +213,11 @@ s! {
213213
}
214214

215215
cfg_if! {
216-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
216+
if #[cfg(any(
217+
target_env = "gnu",
218+
target_os = "android",
219+
target_env = "musl"
220+
))] {
217221
s! {
218222
pub struct statx {
219223
pub stx_mask: crate::__u32,
@@ -1577,7 +1581,11 @@ cfg_if! {
15771581
}
15781582

15791583
cfg_if! {
1580-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1584+
if #[cfg(any(
1585+
target_env = "gnu",
1586+
target_os = "android",
1587+
target_env = "musl"
1588+
))] {
15811589
pub const AT_STATX_SYNC_TYPE: c_int = 0x6000;
15821590
pub const AT_STATX_SYNC_AS_STAT: c_int = 0x0000;
15831591
pub const AT_STATX_FORCE_SYNC: c_int = 0x2000;
@@ -1980,7 +1988,11 @@ cfg_if! {
19801988

19811989
// The statx syscall, available on some libcs.
19821990
cfg_if! {
1983-
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
1991+
if #[cfg(any(
1992+
target_env = "gnu",
1993+
target_os = "android",
1994+
target_env = "musl"
1995+
))] {
19841996
extern "C" {
19851997
pub fn statx(
19861998
dirfd: c_int,

0 commit comments

Comments
 (0)