Skip to content

Commit ba48336

Browse files
committed
Fix statvfs for DragonFly
1 parent 9ae480c commit ba48336

File tree

3 files changed

+49
-16
lines changed

3 files changed

+49
-16
lines changed

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

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,43 @@ s! {
2121
__unused2: u32,
2222
pub d_name: [::c_char; 256],
2323
}
24+
25+
pub struct uuid {
26+
time_low: u32,
27+
time_mid: u16,
28+
time_hi_and_version: u16,
29+
clock_seq_hi_and_reserved: u8,
30+
clock_seq_low: u8,
31+
node: [u8; 6],
32+
}
33+
34+
pub struct statvfs {
35+
pub f_bsize: ::c_ulong,
36+
pub f_frsize: ::c_ulong,
37+
pub f_blocks: ::fsblkcnt_t,
38+
pub f_bfree: ::fsblkcnt_t,
39+
pub f_bavail: ::fsblkcnt_t,
40+
pub f_files: ::fsfilcnt_t,
41+
pub f_ffree: ::fsfilcnt_t,
42+
pub f_favail: ::fsfilcnt_t,
43+
pub f_fsid: ::c_ulong,
44+
pub f_flag: ::c_ulong,
45+
pub f_namemax: ::c_ulong,
46+
pub f_owner: ::uid_t,
47+
pub f_type: ::c_uint,
48+
pub f_syncreads: u64,
49+
pub f_syncwrites: u64,
50+
pub f_asyncreads: u64,
51+
pub f_asyncwrites: u64,
52+
pub f_fsid_uuid: ::uuid_t,
53+
pub f_uid_uuid: ::uuid_t,
54+
}
2455
}
2556

26-
pub type fsblkcnt_t = ::c_uint;
27-
pub type fsfilcnt_t = ::c_uint;
57+
pub type uuid_t = ::uuid;
58+
59+
pub type fsblkcnt_t = u64;
60+
pub type fsfilcnt_t = u64;
2861

2962
pub const PTHREAD_STACK_MIN: ::size_t = 1024;
3063
pub const KERN_PROC_PATHNAME: ::c_int = 9;

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,20 @@ s! {
2323
pub d_namlen: u8,
2424
pub d_name: [::c_char; 256],
2525
}
26+
27+
pub struct statvfs {
28+
pub f_bavail: ::fsblkcnt_t,
29+
pub f_bfree: ::fsblkcnt_t,
30+
pub f_blocks: ::fsblkcnt_t,
31+
pub f_favail: ::fsfilcnt_t,
32+
pub f_ffree: ::fsfilcnt_t,
33+
pub f_files: ::fsfilcnt_t,
34+
pub f_bsize: ::c_ulong,
35+
pub f_flag: ::c_ulong,
36+
pub f_frsize: ::c_ulong,
37+
pub f_fsid: ::c_ulong,
38+
pub f_namemax: ::c_ulong,
39+
}
2640
}
2741

2842
pub type fsblkcnt_t = ::uint64_t;

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,20 +76,6 @@ s! {
7676
pub ss_flags: ::c_int,
7777
}
7878

79-
pub struct statvfs {
80-
pub f_bavail: ::fsblkcnt_t,
81-
pub f_bfree: ::fsblkcnt_t,
82-
pub f_blocks: ::fsblkcnt_t,
83-
pub f_favail: ::fsfilcnt_t,
84-
pub f_ffree: ::fsfilcnt_t,
85-
pub f_files: ::fsfilcnt_t,
86-
pub f_bsize: ::c_ulong,
87-
pub f_flag: ::c_ulong,
88-
pub f_frsize: ::c_ulong,
89-
pub f_fsid: ::c_ulong,
90-
pub f_namemax: ::c_ulong,
91-
}
92-
9379
pub struct sched_param {
9480
pub sched_priority: ::c_int,
9581
}

0 commit comments

Comments
 (0)