diff --git a/libc-test/build.rs b/libc-test/build.rs index 48b7d7a2d89abd7eb7264ccf4027c1127bc6b9f8..648b0844a21d8ffd215e986d94fdb0fbf429476b 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -1762,6 +1762,18 @@ fn test_freebsd(target: &str) { cfg.skip_const(move |name| { match name { + // These constants are to be introduced in yet-unreleased FreeBSD 12.2. + "F_ADD_SEALS" + | "F_GET_SEALS" + | "F_SEAL_SEAL" + | "F_SEAL_SHRINK" + | "F_SEAL_GROW" + | "F_SEAL_WRITE" + if Some(12) <= freebsd_ver => + { + true + } + // These constants were introduced in FreeBSD 12: "SF_USER_READAHEAD" | "EVFILT_EMPTY" diff --git a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs index e0dd712bbd957807d42f18c9defebb4c4a930726..982855ee5a34e9f3af156a3d153a11c36019e9de 100644 --- a/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs @@ -190,6 +190,13 @@ cfg_if! { } } +pub const F_ADD_SEALS: ::c_int = 19; +pub const F_GET_SEALS: ::c_int = 20; +pub const F_SEAL_SEAL: ::c_int = 0x0001; +pub const F_SEAL_SHRINK: ::c_int = 0x0002; +pub const F_SEAL_GROW: ::c_int = 0x0004; +pub const F_SEAL_WRITE: ::c_int = 0x0008; + cfg_if! { if #[cfg(not(freebsd13))] { pub const ELAST: ::c_int = 96; diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 6b10a95b2ba0a2c19f95d59b63fb47c0154555c3..4b224d057314fa72aec447d0c3b0c9e3f690710e 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1154,6 +1154,15 @@ pub const UF_READONLY: ::c_ulong = 0x00001000; pub const UF_HIDDEN: ::c_ulong = 0x00008000; pub const SF_SNAPSHOT: ::c_ulong = 0x00200000; +pub const F_OGETLK: ::c_int = 7; +pub const F_OSETLK: ::c_int = 8; +pub const F_OSETLKW: ::c_int = 9; +pub const F_DUP2FD: ::c_int = 10; +pub const F_SETLK_REMOTE: ::c_int = 14; +pub const F_READAHEAD: ::c_int = 15; +pub const F_RDAHEAD: ::c_int = 16; +pub const F_DUP2FD_CLOEXEC: ::c_int = 18; + fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES }