Skip to content

Commit 832e942

Browse files
committed
DragonFly has different stat, dirent, clock_t, ino_t, nlink_t, blksize_t
1 parent f3152a3 commit 832e942

File tree

4 files changed

+38
-18
lines changed

4 files changed

+38
-18
lines changed

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,22 @@ cfg_if! {
77
}
88
}
99

10+
pub type clock_t = u64;
11+
pub type ino_t = u64;
12+
pub type nlink_t = u32;
13+
pub type blksize_t = u64;
14+
15+
s! {
16+
pub struct dirent {
17+
pub d_fileno: ::ino_t,
18+
pub d_namelen: u16,
19+
pub d_type: u8,
20+
__unused1: u8,
21+
__unused2: u32,
22+
pub d_name: [::c_char; 256],
23+
}
24+
}
25+
1026
pub type fsblkcnt_t = ::c_uint;
1127
pub type fsfilcnt_t = ::c_uint;
1228

src/unix/bsd/freebsdlike/dragonfly/x86_64.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ pub type suseconds_t = i64;
55

66
s! {
77
pub struct stat {
8-
pub st_dev: ::dev_t,
98
pub st_ino: ::ino_t,
10-
pub st_mode: ::mode_t,
119
pub st_nlink: ::nlink_t,
10+
pub st_dev: ::dev_t,
11+
pub st_mode: ::mode_t,
12+
pub st_padding1: ::uint16_t,
1213
pub st_uid: ::uid_t,
1314
pub st_gid: ::gid_t,
1415
pub st_rdev: ::dev_t,
@@ -19,12 +20,12 @@ s! {
1920
pub st_ctime: ::time_t,
2021
pub st_ctime_nsec: ::c_long,
2122
pub st_size: ::off_t,
22-
pub st_blocks: ::blkcnt_t,
23-
pub st_blksize: ::blksize_t,
23+
pub st_blocks: ::int64_t,
24+
pub st_blksize: ::uint32_t,
2425
pub st_flags: ::fflags_t,
2526
pub st_gen: ::uint32_t,
2627
pub st_lspare: ::int32_t,
27-
pub st_birthtime: ::time_t,
28-
pub st_birthtime_nsec: ::c_long,
28+
pub st_qspare1: ::int64_t,
29+
pub st_qspare2: ::int64_t,
2930
}
3031
}

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ cfg_if! {
1010
}
1111
}
1212

13+
pub type clock_t = i32;
14+
pub type ino_t = u32;
15+
pub type nlink_t = u16;
16+
pub type blksize_t = u32;
17+
18+
s! {
19+
pub struct dirent {
20+
pub d_fileno: u32,
21+
pub d_reclen: u16,
22+
pub d_type: u8,
23+
pub d_namlen: u8,
24+
pub d_name: [::c_char; 256],
25+
}
26+
}
27+
1328
pub type fsblkcnt_t = ::uint64_t;
1429
pub type fsfilcnt_t = ::uint64_t;
1530

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
pub type clock_t = i32;
21
pub type dev_t = u32;
3-
pub type ino_t = u32;
42
pub type mode_t = u16;
5-
pub type nlink_t = u16;
6-
pub type blksize_t = u32;
73
pub type fflags_t = u32;
84
pub type pthread_attr_t = *mut ::c_void;
95
pub type rlim_t = i64;
@@ -18,14 +14,6 @@ pub type speed_t = ::c_uint;
1814
pub enum timezone {}
1915

2016
s! {
21-
pub struct dirent {
22-
pub d_fileno: u32,
23-
pub d_reclen: u16,
24-
pub d_type: u8,
25-
pub d_namlen: u8,
26-
pub d_name: [::c_char; 256],
27-
}
28-
2917
pub struct glob_t {
3018
pub gl_pathc: ::size_t,
3119
__unused1: ::size_t,

0 commit comments

Comments
 (0)