Skip to content

Commit

Permalink
Increase size of cpuset_t on FreeBSD 14
Browse files Browse the repository at this point in the history
  • Loading branch information
asomers committed Oct 18, 2023
1 parent 5be41c9 commit b9671de
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Expand Up @@ -365,9 +365,13 @@ s! {
}

pub struct cpuset_t {
#[cfg(target_pointer_width = "64")]
#[cfg(all(freebsd14, target_pointer_width = "64"))]
__bits: [::c_long; 16],
#[cfg(all(freebsd14, target_pointer_width = "32"))]
__bits: [::c_long; 32],
#[cfg(all(not(freebsd14), target_pointer_width = "64"))]
__bits: [::c_long; 4],
#[cfg(target_pointer_width = "32")]
#[cfg(all(not(freebsd14), target_pointer_width = "32"))]
__bits: [::c_long; 8],
}

Expand Down Expand Up @@ -2613,7 +2617,13 @@ pub const DEVSTAT_N_TRANS_FLAGS: ::c_int = 4;
pub const DEVSTAT_NAME_LEN: ::c_int = 16;

// sys/cpuset.h
pub const CPU_SETSIZE: ::c_int = 256;
cfg_if! {
if #[cfg(freebsd14)] {
pub const CPU_SETSIZE: ::c_int = 1024;
} else {
pub const CPU_SETSIZE: ::c_int = 256;
}
}

pub const SIGEV_THREAD_ID: ::c_int = 4;

Expand Down

0 comments on commit b9671de

Please sign in to comment.