Skip to content

Commit 836d711

Browse files
committed
Move back statx fn and struct to gnu
1 parent 9ca70b5 commit 836d711

File tree

2 files changed

+57
-57
lines changed

2 files changed

+57
-57
lines changed

src/unix/linux_like/linux/gnu/mod.rs

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,36 @@ pub type __priority_which_t = ::c_uint;
33
pub type __rlimit_resource_t = ::c_uint;
44

55
s! {
6+
pub struct statx {
7+
pub stx_mask: u32,
8+
pub stx_blksize: u32,
9+
pub stx_attributes: u64,
10+
pub stx_nlink: u32,
11+
pub stx_uid: u32,
12+
pub stx_gid: u32,
13+
pub stx_mode: u16,
14+
pub __statx_pad1: [u16; 1],
15+
pub stx_ino: u64,
16+
pub stx_size: u64,
17+
pub stx_blocks: u64,
18+
pub stx_attributes_mask: u64,
19+
pub stx_atime: ::statx_timestamp,
20+
pub stx_btime: ::statx_timestamp,
21+
pub stx_ctime: ::statx_timestamp,
22+
pub stx_mtime: ::statx_timestamp,
23+
pub stx_rdev_major: u32,
24+
pub stx_rdev_minor: u32,
25+
pub stx_dev_major: u32,
26+
pub stx_dev_minor: u32,
27+
pub __statx_pad2: [u64; 14],
28+
}
29+
30+
pub struct statx_timestamp {
31+
pub tv_sec: i64,
32+
pub tv_nsec: u32,
33+
pub __statx_timestamp_pad1: [i32; 1],
34+
}
35+
636
pub struct aiocb {
737
pub aio_fildes: ::c_int,
838
pub aio_lio_opcode: ::c_int,
@@ -800,6 +830,32 @@ pub const M_PERTURB: ::c_int = -6;
800830
pub const M_ARENA_TEST: ::c_int = -7;
801831
pub const M_ARENA_MAX: ::c_int = -8;
802832

833+
pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
834+
pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
835+
pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
836+
pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
837+
pub const STATX_TYPE: ::c_uint = 0x0001;
838+
pub const STATX_MODE: ::c_uint = 0x0002;
839+
pub const STATX_NLINK: ::c_uint = 0x0004;
840+
pub const STATX_UID: ::c_uint = 0x0008;
841+
pub const STATX_GID: ::c_uint = 0x0010;
842+
pub const STATX_ATIME: ::c_uint = 0x0020;
843+
pub const STATX_MTIME: ::c_uint = 0x0040;
844+
pub const STATX_CTIME: ::c_uint = 0x0080;
845+
pub const STATX_INO: ::c_uint = 0x0100;
846+
pub const STATX_SIZE: ::c_uint = 0x0200;
847+
pub const STATX_BLOCKS: ::c_uint = 0x0400;
848+
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
849+
pub const STATX_BTIME: ::c_uint = 0x0800;
850+
pub const STATX_ALL: ::c_uint = 0x0fff;
851+
pub const STATX__RESERVED: ::c_int = 0x80000000;
852+
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
853+
pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
854+
pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
855+
pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
856+
pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
857+
pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
858+
803859
cfg_if! {
804860
if #[cfg(any(
805861
target_arch = "arm",
@@ -875,7 +931,7 @@ extern "C" {
875931
pathname: *const c_char,
876932
flags: ::c_int,
877933
mask: ::c_uint,
878-
statxbuf: *mut ::statx,
934+
statxbuf: *mut statx,
879935
) -> ::c_int;
880936
pub fn getrandom(
881937
buf: *mut ::c_void,

src/unix/linux_like/linux/mod.rs

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -46,36 +46,6 @@ impl ::Clone for fpos64_t {
4646
}
4747

4848
s! {
49-
pub struct statx {
50-
pub stx_mask: u32,
51-
pub stx_blksize: u32,
52-
pub stx_attributes: u64,
53-
pub stx_nlink: u32,
54-
pub stx_uid: u32,
55-
pub stx_gid: u32,
56-
pub stx_mode: u16,
57-
pub __statx_pad1: [u16; 1],
58-
pub stx_ino: u64,
59-
pub stx_size: u64,
60-
pub stx_blocks: u64,
61-
pub stx_attributes_mask: u64,
62-
pub stx_atime: ::statx_timestamp,
63-
pub stx_btime: ::statx_timestamp,
64-
pub stx_ctime: ::statx_timestamp,
65-
pub stx_mtime: ::statx_timestamp,
66-
pub stx_rdev_major: u32,
67-
pub stx_rdev_minor: u32,
68-
pub stx_dev_major: u32,
69-
pub stx_dev_minor: u32,
70-
pub __statx_pad2: [u64; 14],
71-
}
72-
73-
pub struct statx_timestamp {
74-
pub tv_sec: i64,
75-
pub tv_nsec: u32,
76-
pub __statx_timestamp_pad1: [i32; 1],
77-
}
78-
7949
pub struct rlimit64 {
8050
pub rlim_cur: rlim64_t,
8151
pub rlim_max: rlim64_t,
@@ -854,32 +824,6 @@ cfg_if! {
854824
}
855825
}
856826

857-
pub const AT_STATX_SYNC_TYPE: ::c_int = 0x6000;
858-
pub const AT_STATX_SYNC_AS_STAT: ::c_int = 0x0000;
859-
pub const AT_STATX_FORCE_SYNC: ::c_int = 0x2000;
860-
pub const AT_STATX_DONT_SYNC: ::c_int = 0x4000;
861-
pub const STATX_TYPE: ::c_uint = 0x0001;
862-
pub const STATX_MODE: ::c_uint = 0x0002;
863-
pub const STATX_NLINK: ::c_uint = 0x0004;
864-
pub const STATX_UID: ::c_uint = 0x0008;
865-
pub const STATX_GID: ::c_uint = 0x0010;
866-
pub const STATX_ATIME: ::c_uint = 0x0020;
867-
pub const STATX_MTIME: ::c_uint = 0x0040;
868-
pub const STATX_CTIME: ::c_uint = 0x0080;
869-
pub const STATX_INO: ::c_uint = 0x0100;
870-
pub const STATX_SIZE: ::c_uint = 0x0200;
871-
pub const STATX_BLOCKS: ::c_uint = 0x0400;
872-
pub const STATX_BASIC_STATS: ::c_uint = 0x07ff;
873-
pub const STATX_BTIME: ::c_uint = 0x0800;
874-
pub const STATX_ALL: ::c_uint = 0x0fff;
875-
pub const STATX__RESERVED: ::c_int = 0x80000000;
876-
pub const STATX_ATTR_COMPRESSED: ::c_int = 0x0004;
877-
pub const STATX_ATTR_IMMUTABLE: ::c_int = 0x0010;
878-
pub const STATX_ATTR_APPEND: ::c_int = 0x0020;
879-
pub const STATX_ATTR_NODUMP: ::c_int = 0x0040;
880-
pub const STATX_ATTR_ENCRYPTED: ::c_int = 0x0800;
881-
pub const STATX_ATTR_AUTOMOUNT: ::c_int = 0x1000;
882-
883827
pub const ABDAY_1: ::nl_item = 0x20000;
884828
pub const ABDAY_2: ::nl_item = 0x20001;
885829
pub const ABDAY_3: ::nl_item = 0x20002;

0 commit comments

Comments
 (0)