Skip to content

Commit

Permalink
Add FreeBSD 14 module
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Nov 17, 2021
1 parent 38c0eaf commit 9f350fc
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 3 deletions.
1 change: 1 addition & 0 deletions libc-test/build.rs
Expand Up @@ -3377,6 +3377,7 @@ fn which_freebsd() -> Option<i32> {
s if s.starts_with("11") => Some(11),
s if s.starts_with("12") => Some(12),
s if s.starts_with("13") => Some(13),
s if s.starts_with("14") => Some(14),
_ => None,
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/dragonfly/mod.rs
Expand Up @@ -1299,6 +1299,8 @@ pub const SF_XLINK: ::c_ulong = 0x01000000;
pub const UTIME_OMIT: c_long = -2;
pub const UTIME_NOW: c_long = -1;

pub const MINCORE_SUPER: ::c_int = 0x20;

const_fn! {
{const} fn _CMSG_ALIGN(n: usize) -> usize {
(n + 3) & !3
Expand Down
1 change: 1 addition & 0 deletions src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs
Expand Up @@ -289,6 +289,7 @@ cfg_if! {
pub const ELAST: ::c_int = 96;
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
pub const KI_NSPARE_PTR: usize = 6;
pub const MINCORE_SUPER: ::c_int = 0x20;

extern "C" {
// Return type ::c_int was removed in FreeBSD 12
Expand Down
2 changes: 2 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs
Expand Up @@ -305,6 +305,8 @@ pub const ELAST: ::c_int = 97;
pub const SPECNAMELEN: ::c_int = 63;
pub const KI_NSPARE_PTR: usize = 6;

pub const MINCORE_SUPER: ::c_int = 0x20;

extern "C" {
pub fn setgrent();
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;
Expand Down
4 changes: 3 additions & 1 deletion src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs
@@ -1,4 +1,4 @@
// APIs in FreeBSD 13 that have changed since 11.
// APIs in FreeBSD 14 that have changed since 11.

pub type nlink_t = u64;
pub type dev_t = u64;
Expand Down Expand Up @@ -334,6 +334,8 @@ pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;

pub const MINCORE_SUPER: ::c_int = 0x20;

f! {
pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
let ngrps = if ngrps > 0 {
Expand Down
34 changes: 34 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/freebsd14/b64.rs
@@ -0,0 +1,34 @@
#[repr(C)]
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::ino_t,
pub st_nlink: ::nlink_t,
pub st_mode: ::mode_t,
st_padding0: i16,
pub st_uid: ::uid_t,
pub st_gid: ::gid_t,
st_padding1: i32,
pub st_rdev: ::dev_t,
pub st_atime: ::time_t,
pub st_atime_nsec: ::c_long,
pub st_mtime: ::time_t,
pub st_mtime_nsec: ::c_long,
pub st_ctime: ::time_t,
pub st_ctime_nsec: ::c_long,
pub st_birthtime: ::time_t,
pub st_birthtime_nsec: ::c_long,
pub st_size: ::off_t,
pub st_blocks: ::blkcnt_t,
pub st_blksize: ::blksize_t,
pub st_flags: ::fflags_t,
pub st_gen: u64,
pub st_spare: [u64; 10],
}

impl ::Copy for ::stat {}
impl ::Clone for ::stat {
fn clone(&self) -> ::stat {
*self
}
}

0 comments on commit 9f350fc

Please sign in to comment.