Skip to content

Commit b63bf71

Browse files
authored
Merge pull request rust-lang#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

Lines changed: 1 addition & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 4 additions & 1 deletion
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

Lines changed: 16 additions & 4 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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

Lines changed: 4 additions & 0 deletions
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;

0 commit comments

Comments
 (0)