|
3 | 3 | use crate::fd::AsFd; |
4 | 4 | use crate::fs::AtFlags; |
5 | 5 | use crate::{backend, io, path}; |
| 6 | +#[cfg(any(linux_raw_dep, not(target_env = "musl")))] |
6 | 7 | use backend::c; |
7 | 8 | use bitflags::bitflags; |
8 | 9 |
|
@@ -275,3 +276,36 @@ mod compat { |
275 | 276 | } |
276 | 277 | } |
277 | 278 | } |
| 279 | + |
| 280 | +// These are the actual values for the constants, needed for the fallback implementation. |
| 281 | +// TODO(https://github.com/bytecodealliance/rustix/issues/1589): try to upstream these |
| 282 | +// constants to libc. |
| 283 | +#[cfg(all(not(linux_raw_dep), target_env = "musl"))] |
| 284 | +mod c { |
| 285 | + pub const STATX_TYPE: u32 = 0x00000001; |
| 286 | + pub const STATX_MODE: u32 = 0x00000002; |
| 287 | + pub const STATX_NLINK: u32 = 0x00000004; |
| 288 | + pub const STATX_UID: u32 = 0x00000008; |
| 289 | + pub const STATX_GID: u32 = 0x00000010; |
| 290 | + pub const STATX_ATIME: u32 = 0x00000020; |
| 291 | + pub const STATX_MTIME: u32 = 0x00000040; |
| 292 | + pub const STATX_CTIME: u32 = 0x00000080; |
| 293 | + pub const STATX_INO: u32 = 0x00000100; |
| 294 | + pub const STATX_SIZE: u32 = 0x00000200; |
| 295 | + pub const STATX_BLOCKS: u32 = 0x00000400; |
| 296 | + pub const STATX_BASIC_STATS: u32 = 0x000007ff; |
| 297 | + pub const STATX_BTIME: u32 = 0x00000800; |
| 298 | + pub const STATX_MNT_ID: u32 = 0x00001000; |
| 299 | + pub const STATX_DIOALIGN: u32 = 0x00002000; // Deprecated, but here for completeness |
| 300 | + pub const STATX_ALL: u32 = 0x00000fff; // Note: Doesn't include newer flags |
| 301 | + |
| 302 | + pub const STATX_ATTR_COMPRESSED: u64 = 0x00000004; |
| 303 | + pub const STATX_ATTR_IMMUTABLE: u64 = 0x00000010; |
| 304 | + pub const STATX_ATTR_APPEND: u64 = 0x00000020; |
| 305 | + pub const STATX_ATTR_NODUMP: u64 = 0x00000040; |
| 306 | + pub const STATX_ATTR_ENCRYPTED: u64 = 0x00000800; |
| 307 | + pub const STATX_ATTR_AUTOMOUNT: u64 = 0x00001000; |
| 308 | + pub const STATX_ATTR_MOUNT_ROOT: u64 = 0x00020000; |
| 309 | + pub const STATX_ATTR_VERITY: u64 = 0x00100000; |
| 310 | + pub const STATX_ATTR_DAX: u64 = 0x00200000; |
| 311 | +} |
0 commit comments