aboutsummaryrefslogtreecommitdiff
path: root/src/unix/bsd/freebsdlike/freebsd/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix/bsd/freebsdlike/freebsd/mod.rs')
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs66
1 files changed, 61 insertions, 5 deletions
diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs
index 4138af57..c654ae42 100644
--- a/src/unix/bsd/freebsdlike/freebsd/mod.rs
+++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs
@@ -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],
}
@@ -967,6 +971,8 @@ s! {
pub ifc_len: ::c_int,
#[cfg(libc_union)]
pub ifc_ifcu: __c_anonymous_ifc_ifcu,
+ #[cfg(not(libc_union))]
+ pub ifc_ifcu: *mut ifreq,
}
pub struct au_mask_t {
@@ -996,6 +1002,8 @@ s! {
pub pcbcnt: u32,
}
+ // Note: this structure will change in a backwards-incompatible way in
+ // FreeBSD 15.
pub struct tcp_info {
pub tcpi_state: u8,
pub __tcpi_ca_state: u8,
@@ -1053,7 +1061,21 @@ s! {
#[cfg(freebsd14)]
pub __tcpi_received_ce_bytes: u32,
#[cfg(freebsd14)]
- pub __tcpi_pad: [u32; 19],
+ pub tcpi_total_tlp: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_total_tlp_bytes: u64,
+ #[cfg(freebsd14)]
+ pub tcpi_snd_una: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_snd_max: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_rcv_numsacks: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_rcv_adv: u32,
+ #[cfg(freebsd14)]
+ pub tcpi_dupacks: u32,
+ #[cfg(freebsd14)]
+ pub __tcpi_pad: [u32; 10],
#[cfg(not(freebsd14))]
pub __tcpi_pad: [u32; 26],
}
@@ -2597,7 +2619,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;
@@ -2664,7 +2692,9 @@ pub const Q_SETQUOTA: ::c_int = 0x800;
pub const MAP_GUARD: ::c_int = 0x00002000;
pub const MAP_EXCL: ::c_int = 0x00004000;
pub const MAP_PREFAULT_READ: ::c_int = 0x00040000;
-pub const MAP_ALIGNED_SUPER: ::c_int = 1 << 24;
+pub const MAP_ALIGNMENT_SHIFT: ::c_int = 24;
+pub const MAP_ALIGNMENT_MASK: ::c_int = 0xff << MAP_ALIGNMENT_SHIFT;
+pub const MAP_ALIGNED_SUPER: ::c_int = 1 << MAP_ALIGNMENT_SHIFT;
pub const POSIX_FADV_NORMAL: ::c_int = 0;
pub const POSIX_FADV_RANDOM: ::c_int = 1;
@@ -3168,6 +3198,7 @@ pub const IFF_LOOPBACK: ::c_int = 0x8;
/// (i) is a point-to-point link
pub const IFF_POINTOPOINT: ::c_int = 0x10;
/// (i) calls if_input in net epoch
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_KNOWSEPOCH: ::c_int = 0x20;
/// (d) resources allocated
pub const IFF_RUNNING: ::c_int = 0x40;
@@ -3215,6 +3246,7 @@ pub const IFF_DYING: ::c_int = 0x200000;
/// (n) interface is being renamed
pub const IFF_RENAMING: ::c_int = 0x400000;
/// interface is not part of any groups
+#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")]
pub const IFF_NOGROUP: ::c_int = 0x800000;
/// link invalid/unknown
@@ -4693,6 +4725,11 @@ pub const RB_POWERCYCLE: ::c_int = 0x400000;
pub const RB_PROBE: ::c_int = 0x10000000;
pub const RB_MULTIPLE: ::c_int = 0x20000000;
+// sys/timerfd.h
+
+pub const TFD_NONBLOCK: ::c_int = ::O_NONBLOCK;
+pub const TFD_CLOEXEC: ::c_int = O_CLOEXEC;
+
cfg_if! {
if #[cfg(libc_const_extern_fn)] {
pub const fn MAP_ALIGNED(a: ::c_int) -> ::c_int {
@@ -4820,6 +4857,14 @@ f! {
};
::mem::size_of::<sockcred2>() + ::mem::size_of::<::gid_t>() * ngrps
}
+
+ pub fn PROT_MAX(x: ::c_int) -> ::c_int {
+ x << 16
+ }
+
+ pub fn PROT_MAX_EXTRACT(x: ::c_int) -> ::c_int {
+ (x >> 16) & (::PROT_READ | ::PROT_WRITE | ::PROT_EXEC)
+ }
}
safe_f! {
@@ -5406,6 +5451,17 @@ extern "C" {
infotype: *mut ::c_uint,
flags: *mut ::c_int,
) -> ::ssize_t;
+
+ pub fn timerfd_create(clockid: ::c_int, flags: ::c_int) -> ::c_int;
+ pub fn timerfd_gettime(fd: ::c_int, curr_value: *mut itimerspec) -> ::c_int;
+ pub fn timerfd_settime(
+ fd: ::c_int,
+ flags: ::c_int,
+ new_value: *const itimerspec,
+ old_value: *mut itimerspec,
+ ) -> ::c_int;
+ pub fn closefrom(lowfd: ::c_int);
+ pub fn close_range(lowfd: ::c_uint, highfd: ::c_uint, flags: ::c_int) -> ::c_int;
}
#[link(name = "memstat")]