Skip to content

Commit 9f350fc

Browse files
committed
Add FreeBSD 14 module
1 parent 38c0eaf commit 9f350fc

File tree

10 files changed

+478
-3
lines changed

10 files changed

+478
-3
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3377,6 +3377,7 @@ fn which_freebsd() -> Option<i32> {
33773377
s if s.starts_with("11") => Some(11),
33783378
s if s.starts_with("12") => Some(12),
33793379
s if s.starts_with("13") => Some(13),
3380+
s if s.starts_with("14") => Some(14),
33803381
_ => None,
33813382
}
33823383
}

src/unix/bsd/freebsdlike/dragonfly/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,6 +1299,8 @@ pub const SF_XLINK: ::c_ulong = 0x01000000;
12991299
pub const UTIME_OMIT: c_long = -2;
13001300
pub const UTIME_NOW: c_long = -1;
13011301

1302+
pub const MINCORE_SUPER: ::c_int = 0x20;
1303+
13021304
const_fn! {
13031305
{const} fn _CMSG_ALIGN(n: usize) -> usize {
13041306
(n + 3) & !3

src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,7 @@ cfg_if! {
289289
pub const ELAST: ::c_int = 96;
290290
pub const RAND_MAX: ::c_int = 0x7fff_fffd;
291291
pub const KI_NSPARE_PTR: usize = 6;
292+
pub const MINCORE_SUPER: ::c_int = 0x20;
292293

293294
extern "C" {
294295
// Return type ::c_int was removed in FreeBSD 12

src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,8 @@ pub const ELAST: ::c_int = 97;
305305
pub const SPECNAMELEN: ::c_int = 63;
306306
pub const KI_NSPARE_PTR: usize = 6;
307307

308+
pub const MINCORE_SUPER: ::c_int = 0x20;
309+
308310
extern "C" {
309311
pub fn setgrent();
310312
pub fn mprotect(addr: *mut ::c_void, len: ::size_t, prot: ::c_int) -> ::c_int;

src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// APIs in FreeBSD 13 that have changed since 11.
1+
// APIs in FreeBSD 14 that have changed since 11.
22

33
pub type nlink_t = u64;
44
pub type dev_t = u64;
@@ -334,6 +334,8 @@ pub const DOMAINSET_POLICY_FIRSTTOUCH: ::c_int = 2;
334334
pub const DOMAINSET_POLICY_PREFER: ::c_int = 3;
335335
pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
336336

337+
pub const MINCORE_SUPER: ::c_int = 0x20;
338+
337339
f! {
338340
pub fn SOCKCRED2SIZE(ngrps: usize) -> usize {
339341
let ngrps = if ngrps > 0 {
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#[repr(C)]
2+
#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))]
3+
pub struct stat {
4+
pub st_dev: ::dev_t,
5+
pub st_ino: ::ino_t,
6+
pub st_nlink: ::nlink_t,
7+
pub st_mode: ::mode_t,
8+
st_padding0: i16,
9+
pub st_uid: ::uid_t,
10+
pub st_gid: ::gid_t,
11+
st_padding1: i32,
12+
pub st_rdev: ::dev_t,
13+
pub st_atime: ::time_t,
14+
pub st_atime_nsec: ::c_long,
15+
pub st_mtime: ::time_t,
16+
pub st_mtime_nsec: ::c_long,
17+
pub st_ctime: ::time_t,
18+
pub st_ctime_nsec: ::c_long,
19+
pub st_birthtime: ::time_t,
20+
pub st_birthtime_nsec: ::c_long,
21+
pub st_size: ::off_t,
22+
pub st_blocks: ::blkcnt_t,
23+
pub st_blksize: ::blksize_t,
24+
pub st_flags: ::fflags_t,
25+
pub st_gen: u64,
26+
pub st_spare: [u64; 10],
27+
}
28+
29+
impl ::Copy for ::stat {}
30+
impl ::Clone for ::stat {
31+
fn clone(&self) -> ::stat {
32+
*self
33+
}
34+
}

0 commit comments

Comments
 (0)