Skip to content

Commit 38313b7

Browse files
asomerstgross35
authored andcommitted
Fix the definition of domainset_t in 32-bit FreeBSD
It's always had the wrong size, but apparently never been tested on 32-bit FreeBSD. In addition to fixing its size, it ought to be moved info freebsd/mod.rs . Otherwise it's pretty much inaccessible to everyone. https://github.com/freebsd/freebsd-src/blob/main/sys/sys/_domainset.h (backport <rust-lang#3948>) (cherry picked from commit 19d213d)
1 parent 1e04e9c commit 38313b7

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

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 {

0 commit comments

Comments
 (0)