Skip to content

Commit

Permalink
Fix the definition of domainset_t in 32-bit FreeBSD
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
asomers authored and tgross35 committed Nov 7, 2024
1 parent b5aeb93 commit 36b0349
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ s! {
}

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

pub struct kinfo_proc {
Expand Down
5 changes: 4 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ s! {
}

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

pub struct kinfo_proc {
Expand Down
5 changes: 4 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ s! {
}

pub struct __c_anonymous_domainset {
_priv: [::uintptr_t; 4],
#[cfg(target_pointer_width = "64")]
_priv: [::c_ulong; 4],
#[cfg(target_pointer_width = "32")]
_priv: [::c_ulong; 8],
}

pub struct kinfo_proc {
Expand Down

0 comments on commit 36b0349

Please sign in to comment.