Skip to content

Enable statx on musl-libc #3976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/unix/linux_like/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ cfg_if! {
}

cfg_if! {
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
if #[cfg(any(
target_env = "gnu",
target_os = "android",
all(target_env = "musl", musl_v1_2_3)
))] {
s! {
pub struct statx {
pub stx_mask: crate::__u32,
Expand Down Expand Up @@ -1658,7 +1662,11 @@ cfg_if! {
}

cfg_if! {
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
if #[cfg(any(
target_env = "gnu",
target_os = "android",
all(target_env = "musl", musl_v1_2_3)
))] {
pub const AT_STATX_SYNC_TYPE: c_int = 0x6000;
pub const AT_STATX_SYNC_AS_STAT: c_int = 0x0000;
pub const AT_STATX_FORCE_SYNC: c_int = 0x2000;
Expand Down Expand Up @@ -2168,7 +2176,11 @@ cfg_if! {

// The statx syscall, available on some libcs.
cfg_if! {
if #[cfg(any(target_env = "gnu", target_os = "android"))] {
if #[cfg(any(
target_env = "gnu",
target_os = "android",
all(target_env = "musl", musl_v1_2_3)
))] {
extern "C" {
pub fn statx(
dirfd: c_int,
Expand Down
Loading