diff --git a/libc-test/build.rs b/libc-test/build.rs index 48b7d7a2d89abd7eb7264ccf4027c1127bc6b9f8..696f19497815de015c6ddb26d6c84d2dbd758b32 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/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 6b10a95b2ba0a2c19f95d59b63fb47c0154555c3..f35d2834bc90512a35ee59140758612c56d9f35b 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1154,6 +1154,23 @@ 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; +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; + + fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES }