Skip to content

Commit b63bf71

Browse files
authored
Merge pull request #3948 from asomers/main-i386-fbsd12
Fix tests on FreeBSD x86
2 parents 93dbb12 + 0b6cab8 commit b63bf71

File tree

13 files changed

+70
-13
lines changed

13 files changed

+70
-13
lines changed

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

+1
Original file line numberDiff line numberDiff line change
@@ -1462,6 +1462,7 @@ pub const TIOCISPTMASTER: ::c_ulong = 0x20007455;
14621462
pub const TIOCMODG: ::c_ulong = 0x40047403;
14631463
pub const TIOCMODS: ::c_ulong = 0x80047404;
14641464
pub const TIOCREMOTE: ::c_ulong = 0x80047469;
1465+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
14651466

14661467
// Constants used by "at" family of system calls.
14671468
pub const AT_FDCWD: ::c_int = 0xFFFAFDCD; // invalid file descriptor

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type c_long = i64;
33
pub type c_ulong = u64;
4+
pub type clock_t = i32;
45
pub type wchar_t = u32;
56
pub type time_t = i64;
67
pub type suseconds_t = i64;
@@ -133,5 +134,8 @@ cfg_if! {
133134
}
134135
}
135136

137+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
138+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
136139
pub const MAP_32BIT: ::c_int = 0x00080000;
137140
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
141+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type c_long = i32;
33
pub type c_ulong = u32;
4+
pub type clock_t = u32;
45
pub type wchar_t = u32;
56
pub type time_t = i64;
67
pub type suseconds_t = i32;
@@ -50,5 +51,8 @@ cfg_if! {
5051
}
5152

5253
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
54+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
55+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
5356
pub const MAP_32BIT: ::c_int = 0x00080000;
5457
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
58+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ s! {
4141
}
4242

4343
pub struct __c_anonymous_domainset {
44-
_priv: [::uintptr_t; 4],
44+
#[cfg(target_pointer_width = "64")]
45+
_priv: [::c_ulong; 4],
46+
#[cfg(target_pointer_width = "32")]
47+
_priv: [::c_ulong; 8],
4548
}
4649

4750
pub struct kinfo_proc {

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ s! {
4141
}
4242

4343
pub struct __c_anonymous_domainset {
44-
_priv: [::uintptr_t; 4],
44+
#[cfg(target_pointer_width = "64")]
45+
_priv: [::c_ulong; 4],
46+
#[cfg(target_pointer_width = "32")]
47+
_priv: [::c_ulong; 8],
4548
}
4649

4750
pub struct kinfo_proc {

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

+4-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ s! {
4141
}
4242

4343
pub struct __c_anonymous_domainset {
44-
_priv: [::uintptr_t; 4],
44+
#[cfg(target_pointer_width = "64")]
45+
_priv: [::c_ulong; 4],
46+
#[cfg(target_pointer_width = "32")]
47+
_priv: [::c_ulong; 8],
4548
}
4649

4750
pub struct kinfo_proc {

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

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
pub type fflags_t = u32;
2-
pub type clock_t = i32;
32

43
pub type vm_prot_t = u_char;
54
pub type kvaddr_t = u64;
@@ -1630,7 +1629,7 @@ s_no_extra_traits! {
16301629
pub kf_flags: ::c_int,
16311630
_kf_pad0: ::c_int,
16321631
pub kf_offset: i64,
1633-
_priv: [::uintptr_t; 38], // FIXME if needed
1632+
_priv: [u8; 304], // FIXME: this is really a giant union
16341633
pub kf_status: u16,
16351634
_kf_pad1: u16,
16361635
_kf_ispare0: ::c_int,
@@ -3146,9 +3145,22 @@ pub const H4DISC: ::c_int = 0x7;
31463145

31473146
pub const VM_TOTAL: ::c_int = 1;
31483147

3149-
pub const BIOCSETFNR: ::c_ulong = 0x80104282;
3148+
cfg_if! {
3149+
if #[cfg(target_pointer_width = "64")] {
3150+
pub const BIOCSETFNR: ::c_ulong = 0x80104282;
3151+
} else {
3152+
pub const BIOCSETFNR: ::c_ulong = 0x80084282;
3153+
}
3154+
}
3155+
3156+
cfg_if! {
3157+
if #[cfg(target_pointer_width = "64")] {
3158+
pub const FIODGNAME: ::c_ulong = 0x80106678;
3159+
} else {
3160+
pub const FIODGNAME: ::c_ulong = 0x80086678;
3161+
}
3162+
}
31503163

3151-
pub const FIODGNAME: ::c_ulong = 0x80106678;
31523164
pub const FIONWRITE: ::c_ulong = 0x40046677;
31533165
pub const FIONSPACE: ::c_ulong = 0x40046676;
31543166
pub const FIOSEEKDATA: ::c_ulong = 0xc0086661;

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type c_long = i32;
33
pub type c_ulong = u32;
4+
pub type clock_t = u32;
45
pub type wchar_t = i32;
56
pub type time_t = i64;
67
pub type suseconds_t = i32;
@@ -69,5 +70,8 @@ cfg_if! {
6970
}
7071

7172
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_int>() - 1;
73+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
74+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
7275
pub const MAP_32BIT: ::c_int = 0x00080000;
7376
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
77+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type c_long = i64;
33
pub type c_ulong = u64;
4+
pub type clock_t = u32;
45
pub type wchar_t = i32;
56
pub type time_t = i64;
67
pub type suseconds_t = i64;
@@ -69,5 +70,8 @@ cfg_if! {
6970
}
7071

7172
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
73+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
74+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
7275
pub const MAP_32BIT: ::c_int = 0x00080000;
7376
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
77+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

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

+4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = u8;
22
pub type c_long = i64;
33
pub type c_ulong = u64;
4+
pub type clock_t = i32;
45
pub type wchar_t = ::c_int;
56
pub type time_t = i64;
67
pub type suseconds_t = ::c_long;
@@ -141,5 +142,8 @@ cfg_if! {
141142
}
142143
}
143144

145+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
146+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
144147
pub const MAP_32BIT: ::c_int = 0x00080000;
145148
pub const MINSIGSTKSZ: ::size_t = 4096; // 1024 * 4
149+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;

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

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
pub type c_char = i8;
22
pub type c_long = i32;
33
pub type c_ulong = u32;
4+
pub type clock_t = ::c_ulong;
45
pub type wchar_t = i32;
56
pub type time_t = i32;
67
pub type suseconds_t = i32;
78
pub type register_t = i32;
89

910
s_no_extra_traits! {
11+
#[repr(align(16))]
1012
pub struct mcontext_t {
1113
pub mc_onstack: register_t,
1214
pub mc_gs: register_t,
@@ -32,7 +34,7 @@ s_no_extra_traits! {
3234
pub mc_fpformat: ::c_int,
3335
pub mc_ownedfp: ::c_int,
3436
pub mc_flags: register_t,
35-
pub mc_fpstate: [[::c_int; 32]; 4],
37+
pub mc_fpstate: [::c_int; 128],
3638
pub mc_fsbase: register_t,
3739
pub mc_gsbase: register_t,
3840
pub mc_xfpustate: register_t,
@@ -155,4 +157,7 @@ cfg_if! {
155157

156158
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
157159

160+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8008426d;
161+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4008426e;
158162
pub const KINFO_FILE_SIZE: ::c_int = 1392;
163+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40087459;

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

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
pub type c_char = i8;
22
pub type c_long = i64;
33
pub type c_ulong = u64;
4+
pub type clock_t = i32;
45
pub type wchar_t = i32;
56
pub type time_t = i64;
67
pub type suseconds_t = i64;
@@ -220,6 +221,9 @@ cfg_if! {
220221

221222
pub(crate) const _ALIGNBYTES: usize = ::mem::size_of::<::c_long>() - 1;
222223

224+
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
225+
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
226+
223227
pub const MAP_32BIT: ::c_int = 0x00080000;
224228
pub const MINSIGSTKSZ: ::size_t = 2048; // 512 * 4
225229

@@ -236,5 +240,7 @@ pub const _MC_FPOWNED_PCB: c_long = 0x20002;
236240

237241
pub const KINFO_FILE_SIZE: ::c_int = 1392;
238242

243+
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
244+
239245
mod align;
240246
pub use self::align::*;

src/unix/bsd/freebsdlike/mod.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -1243,7 +1243,6 @@ pub const TIOCGETD: ::c_ulong = 0x4004741a;
12431243
pub const TIOCSETD: ::c_ulong = 0x8004741b;
12441244
pub const TIOCGDRAINWAIT: ::c_ulong = 0x40047456;
12451245
pub const TIOCSDRAINWAIT: ::c_ulong = 0x80047457;
1246-
pub const TIOCTIMESTAMP: ::c_ulong = 0x40107459;
12471246
pub const TIOCMGDTRWAIT: ::c_ulong = 0x4004745a;
12481247
pub const TIOCMSDTRWAIT: ::c_ulong = 0x8004745b;
12491248
pub const TIOCDRAIN: ::c_ulong = 0x2000745e;
@@ -1298,10 +1297,15 @@ pub const BIOCSRSIG: ::c_ulong = 0x80044273;
12981297
pub const BIOCSDLT: ::c_ulong = 0x80044278;
12991298
pub const BIOCGSEESENT: ::c_ulong = 0x40044276;
13001299
pub const BIOCSSEESENT: ::c_ulong = 0x80044277;
1301-
pub const BIOCSETF: ::c_ulong = 0x80104267;
1302-
pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
1303-
pub const BIOCSRTIMEOUT: ::c_ulong = 0x8010426d;
1304-
pub const BIOCGRTIMEOUT: ::c_ulong = 0x4010426e;
1300+
cfg_if! {
1301+
if #[cfg(target_pointer_width = "64")] {
1302+
pub const BIOCGDLTLIST: ::c_ulong = 0xc0104279;
1303+
pub const BIOCSETF: ::c_ulong = 0x80104267;
1304+
} else if #[cfg(target_pointer_width = "32")] {
1305+
pub const BIOCGDLTLIST: ::c_ulong = 0xc0084279;
1306+
pub const BIOCSETF: ::c_ulong = 0x80084267;
1307+
}
1308+
}
13051309

13061310
pub const FIODTYPE: ::c_ulong = 0x4004667a;
13071311
pub const FIOGETLBA: ::c_ulong = 0x40046679;

0 commit comments

Comments
 (0)