Skip to content

Commit 9ca4ae9

Browse files
xbjfktgross35
authored andcommitted
musl: Merge stat64 and stat with stat
The structures are the same - and this follows the upstream definition On musl at least, blkcnt64_t == blkcnt_t == i64 and ino_t == ino64_t == u64
1 parent de1bd4e commit 9ca4ae9

File tree

13 files changed

+28
-295
lines changed

13 files changed

+28
-295
lines changed

src/unix/linux_like/linux/musl/b32/arm/mod.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use crate::prelude::*;
33

44
pub type wchar_t = u32;
55

6+
pub type stat64 = stat;
7+
68
s! {
79
pub struct stat {
810
pub st_dev: crate::dev_t,
@@ -26,28 +28,6 @@ s! {
2628
pub st_ino: crate::ino_t,
2729
}
2830

29-
pub struct stat64 {
30-
pub st_dev: crate::dev_t,
31-
__st_dev_padding: Padding<c_int>,
32-
__st_ino_truncated: c_long,
33-
pub st_mode: crate::mode_t,
34-
pub st_nlink: crate::nlink_t,
35-
pub st_uid: crate::uid_t,
36-
pub st_gid: crate::gid_t,
37-
pub st_rdev: crate::dev_t,
38-
__st_rdev_padding: Padding<c_int>,
39-
pub st_size: off_t,
40-
pub st_blksize: crate::blksize_t,
41-
pub st_blocks: crate::blkcnt_t,
42-
pub st_atime: crate::time_t,
43-
pub st_atime_nsec: c_long,
44-
pub st_mtime: crate::time_t,
45-
pub st_mtime_nsec: c_long,
46-
pub st_ctime: crate::time_t,
47-
pub st_ctime_nsec: c_long,
48-
pub st_ino: crate::ino_t,
49-
}
50-
5131
pub struct stack_t {
5232
pub ss_sp: *mut c_void,
5333
pub ss_flags: c_int,

src/unix/linux_like/linux/musl/b32/mips/mod.rs

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use crate::prelude::*;
33

44
pub type wchar_t = c_int;
55

6+
pub type stat64 = stat;
7+
68
s! {
79
pub struct stat {
810
pub st_dev: crate::dev_t,
@@ -27,29 +29,6 @@ s! {
2729
__st_padding4: Padding<[c_long; 14]>,
2830
}
2931

30-
pub struct stat64 {
31-
pub st_dev: crate::dev_t,
32-
__st_padding1: Padding<[c_long; 2]>,
33-
pub st_ino: crate::ino64_t,
34-
pub st_mode: crate::mode_t,
35-
pub st_nlink: crate::nlink_t,
36-
pub st_uid: crate::uid_t,
37-
pub st_gid: crate::gid_t,
38-
pub st_rdev: crate::dev_t,
39-
__st_padding2: Padding<[c_long; 2]>,
40-
pub st_size: off_t,
41-
pub st_atime: crate::time_t,
42-
pub st_atime_nsec: c_long,
43-
pub st_mtime: crate::time_t,
44-
pub st_mtime_nsec: c_long,
45-
pub st_ctime: crate::time_t,
46-
pub st_ctime_nsec: c_long,
47-
pub st_blksize: crate::blksize_t,
48-
__st_padding3: Padding<c_long>,
49-
pub st_blocks: crate::blkcnt64_t,
50-
__st_padding4: Padding<[c_long; 14]>,
51-
}
52-
5332
pub struct stack_t {
5433
pub ss_sp: *mut c_void,
5534
pub ss_size: size_t,

src/unix/linux_like/linux/musl/b32/powerpc.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use crate::prelude::*;
33

44
pub type wchar_t = i32;
55

6+
pub type stat64 = stat;
7+
68
s! {
79
pub struct termios {
810
pub c_iflag: crate::tcflag_t,
@@ -36,27 +38,6 @@ s! {
3638
__unused: Padding<[c_long; 2]>,
3739
}
3840

39-
pub struct stat64 {
40-
pub st_dev: crate::dev_t,
41-
pub st_ino: crate::ino_t,
42-
pub st_mode: crate::mode_t,
43-
pub st_nlink: crate::nlink_t,
44-
pub st_uid: crate::uid_t,
45-
pub st_gid: crate::gid_t,
46-
pub st_rdev: crate::dev_t,
47-
__st_rdev_padding: Padding<c_short>,
48-
pub st_size: off_t,
49-
pub st_blksize: crate::blksize_t,
50-
pub st_blocks: crate::blkcnt_t,
51-
pub st_atime: crate::time_t,
52-
pub st_atime_nsec: c_long,
53-
pub st_mtime: crate::time_t,
54-
pub st_mtime_nsec: c_long,
55-
pub st_ctime: crate::time_t,
56-
pub st_ctime_nsec: c_long,
57-
__unused: Padding<[c_long; 2]>,
58-
}
59-
6041
pub struct stack_t {
6142
pub ss_sp: *mut c_void,
6243
pub ss_flags: c_int,

src/unix/linux_like/linux/musl/b32/riscv32/mod.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
//! RISC-V-specific definitions for 32-bit linux-like values
22
3+
use crate::off_t;
34
use crate::prelude::*;
4-
use crate::{
5-
off64_t,
6-
off_t,
7-
};
85

96
pub type wchar_t = c_int;
107

8+
pub type stat64 = stat;
9+
1110
s! {
1211
pub struct stat {
1312
pub st_dev: crate::dev_t,
@@ -31,28 +30,6 @@ s! {
3130
__unused: Padding<[c_int; 2usize]>,
3231
}
3332

34-
pub struct stat64 {
35-
pub st_dev: crate::dev_t,
36-
pub st_ino: crate::ino64_t,
37-
pub st_mode: crate::mode_t,
38-
pub st_nlink: crate::nlink_t,
39-
pub st_uid: crate::uid_t,
40-
pub st_gid: crate::gid_t,
41-
pub st_rdev: crate::dev_t,
42-
pub __pad1: crate::dev_t,
43-
pub st_size: off64_t,
44-
pub st_blksize: crate::blksize_t,
45-
pub __pad2: c_int,
46-
pub st_blocks: crate::blkcnt64_t,
47-
pub st_atime: crate::time_t,
48-
pub st_atime_nsec: c_long,
49-
pub st_mtime: crate::time_t,
50-
pub st_mtime_nsec: c_long,
51-
pub st_ctime: crate::time_t,
52-
pub st_ctime_nsec: c_long,
53-
__unused: Padding<[c_int; 2]>,
54-
}
55-
5633
pub struct stack_t {
5734
pub ss_sp: *mut c_void,
5835
pub ss_flags: c_int,

src/unix/linux_like/linux/musl/b32/x86/mod.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ use crate::prelude::*;
33

44
pub type wchar_t = i32;
55

6+
pub type stat64 = stat;
7+
68
s! {
79
pub struct stat {
810
pub st_dev: crate::dev_t,
@@ -26,28 +28,6 @@ s! {
2628
pub st_ino: crate::ino_t,
2729
}
2830

29-
pub struct stat64 {
30-
pub st_dev: crate::dev_t,
31-
__st_dev_padding: Padding<c_int>,
32-
__st_ino_truncated: c_long,
33-
pub st_mode: crate::mode_t,
34-
pub st_nlink: crate::nlink_t,
35-
pub st_uid: crate::uid_t,
36-
pub st_gid: crate::gid_t,
37-
pub st_rdev: crate::dev_t,
38-
__st_rdev_padding: Padding<c_int>,
39-
pub st_size: off_t,
40-
pub st_blksize: crate::blksize_t,
41-
pub st_blocks: crate::blkcnt_t,
42-
pub st_atime: crate::time_t,
43-
pub st_atime_nsec: c_long,
44-
pub st_mtime: crate::time_t,
45-
pub st_mtime_nsec: c_long,
46-
pub st_ctime: crate::time_t,
47-
pub st_ctime_nsec: c_long,
48-
pub st_ino: crate::ino_t,
49-
}
50-
5131
pub struct mcontext_t {
5232
__private: [u32; 22],
5333
}

src/unix/linux_like/linux/musl/b64/aarch64/mod.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pub type wchar_t = u32;
77
pub type nlink_t = u32;
88
pub type blksize_t = c_int;
99

10+
pub type stat64 = stat;
11+
1012
s! {
1113
pub struct stat {
1214
pub st_dev: crate::dev_t,
@@ -30,28 +32,6 @@ s! {
3032
__unused: Padding<[c_uint; 2]>,
3133
}
3234

33-
pub struct stat64 {
34-
pub st_dev: crate::dev_t,
35-
pub st_ino: crate::ino_t,
36-
pub st_mode: crate::mode_t,
37-
pub st_nlink: crate::nlink_t,
38-
pub st_uid: crate::uid_t,
39-
pub st_gid: crate::gid_t,
40-
pub st_rdev: crate::dev_t,
41-
__pad0: Padding<c_ulong>,
42-
pub st_size: off_t,
43-
pub st_blksize: crate::blksize_t,
44-
__pad1: Padding<c_int>,
45-
pub st_blocks: crate::blkcnt_t,
46-
pub st_atime: crate::time_t,
47-
pub st_atime_nsec: c_long,
48-
pub st_mtime: crate::time_t,
49-
pub st_mtime_nsec: c_long,
50-
pub st_ctime: crate::time_t,
51-
pub st_ctime_nsec: c_long,
52-
__unused: Padding<[c_uint; 2]>,
53-
}
54-
5535
pub struct user_regs_struct {
5636
pub regs: [c_ulonglong; 31],
5737
pub sp: c_ulonglong,

src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
//! LoongArch-specific definitions for 64-bit linux-like values
22
3+
use crate::off_t;
34
use crate::prelude::*;
4-
use crate::{
5-
off64_t,
6-
off_t,
7-
};
85

96
pub type wchar_t = c_int;
107

@@ -13,6 +10,8 @@ pub type blksize_t = c_int;
1310
pub type __u64 = c_ulonglong;
1411
pub type __s64 = c_longlong;
1512

13+
pub type stat64 = stat;
14+
1615
s! {
1716
pub struct stat {
1817
pub st_dev: crate::dev_t,
@@ -36,28 +35,6 @@ s! {
3635
__unused: Padding<[c_int; 2usize]>,
3736
}
3837

39-
pub struct stat64 {
40-
pub st_dev: crate::dev_t,
41-
pub st_ino: crate::ino64_t,
42-
pub st_mode: crate::mode_t,
43-
pub st_nlink: crate::nlink_t,
44-
pub st_uid: crate::uid_t,
45-
pub st_gid: crate::gid_t,
46-
pub st_rdev: crate::dev_t,
47-
pub __pad1: crate::dev_t,
48-
pub st_size: off64_t,
49-
pub st_blksize: crate::blksize_t,
50-
pub __pad2: c_int,
51-
pub st_blocks: crate::blkcnt_t,
52-
pub st_atime: crate::time_t,
53-
pub st_atime_nsec: c_long,
54-
pub st_mtime: crate::time_t,
55-
pub st_mtime_nsec: c_long,
56-
pub st_ctime: crate::time_t,
57-
pub st_ctime_nsec: c_long,
58-
__unused: Padding<[c_int; 2]>,
59-
}
60-
6138
pub struct ipc_perm {
6239
pub __key: crate::key_t,
6340
pub uid: crate::uid_t,

src/unix/linux_like/linux/musl/b64/mips64.rs

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pub type __s64 = c_long;
77
pub type nlink_t = c_uint;
88
pub type blksize_t = i64;
99

10+
pub type stat64 = stat;
11+
1012
s! {
1113
pub struct stat {
1214
pub st_dev: crate::dev_t,
@@ -32,30 +34,6 @@ s! {
3234
__pad5: Padding<[c_int; 14]>,
3335
}
3436

35-
pub struct stat64 {
36-
pub st_dev: crate::dev_t,
37-
__pad1: Padding<[c_int; 3]>,
38-
pub st_ino: crate::ino_t,
39-
pub st_mode: crate::mode_t,
40-
pub st_nlink: crate::nlink_t,
41-
pub st_uid: crate::uid_t,
42-
pub st_gid: crate::gid_t,
43-
pub st_rdev: crate::dev_t,
44-
__pad2: Padding<[c_uint; 2]>,
45-
pub st_size: off_t,
46-
__pad3: Padding<c_int>,
47-
pub st_atime: crate::time_t,
48-
pub st_atime_nsec: c_long,
49-
pub st_mtime: crate::time_t,
50-
pub st_mtime_nsec: c_long,
51-
pub st_ctime: crate::time_t,
52-
pub st_ctime_nsec: c_long,
53-
pub st_blksize: crate::blksize_t,
54-
__pad4: Padding<c_uint>,
55-
pub st_blocks: crate::blkcnt_t,
56-
__pad5: Padding<[c_int; 14]>,
57-
}
58-
5937
pub struct stack_t {
6038
pub ss_sp: *mut c_void,
6139
pub ss_size: size_t,

src/unix/linux_like/linux/musl/b64/powerpc64.rs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ pub type __s64 = c_long;
77
pub type nlink_t = u64;
88
pub type blksize_t = c_long;
99

10+
pub type stat64 = stat;
11+
1012
s! {
1113
pub struct termios {
1214
pub c_iflag: crate::tcflag_t,
@@ -40,27 +42,6 @@ s! {
4042
__unused: Padding<[c_long; 3]>,
4143
}
4244

43-
pub struct stat64 {
44-
pub st_dev: crate::dev_t,
45-
pub st_ino: crate::ino64_t,
46-
pub st_nlink: crate::nlink_t,
47-
pub st_mode: crate::mode_t,
48-
pub st_uid: crate::uid_t,
49-
pub st_gid: crate::gid_t,
50-
__pad0: Padding<c_int>,
51-
pub st_rdev: crate::dev_t,
52-
pub st_size: off_t,
53-
pub st_blksize: crate::blksize_t,
54-
pub st_blocks: crate::blkcnt64_t,
55-
pub st_atime: crate::time_t,
56-
pub st_atime_nsec: c_long,
57-
pub st_mtime: crate::time_t,
58-
pub st_mtime_nsec: c_long,
59-
pub st_ctime: crate::time_t,
60-
pub st_ctime_nsec: c_long,
61-
__reserved: Padding<[c_long; 3]>,
62-
}
63-
6445
pub struct shmid_ds {
6546
pub shm_perm: crate::ipc_perm,
6647
pub shm_atime: crate::time_t,

0 commit comments

Comments
 (0)