Skip to content

Commit 19dd18f

Browse files
authored
Merge pull request #1810 from nagisa/freebsd-fcntl
2 parents 9f581e6 + 91fee24 commit 19dd18f

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

libc-test/build.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,18 @@ fn test_freebsd(target: &str) {
17621762

17631763
cfg.skip_const(move |name| {
17641764
match name {
1765+
// These constants are to be introduced in yet-unreleased FreeBSD 12.2.
1766+
"F_ADD_SEALS"
1767+
| "F_GET_SEALS"
1768+
| "F_SEAL_SEAL"
1769+
| "F_SEAL_SHRINK"
1770+
| "F_SEAL_GROW"
1771+
| "F_SEAL_WRITE"
1772+
if Some(12) <= freebsd_ver =>
1773+
{
1774+
true
1775+
}
1776+
17651777
// These constants were introduced in FreeBSD 12:
17661778
"SF_USER_READAHEAD"
17671779
| "EVFILT_EMPTY"

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ cfg_if! {
190190
}
191191
}
192192

193+
pub const F_ADD_SEALS: ::c_int = 19;
194+
pub const F_GET_SEALS: ::c_int = 20;
195+
pub const F_SEAL_SEAL: ::c_int = 0x0001;
196+
pub const F_SEAL_SHRINK: ::c_int = 0x0002;
197+
pub const F_SEAL_GROW: ::c_int = 0x0004;
198+
pub const F_SEAL_WRITE: ::c_int = 0x0008;
199+
193200
cfg_if! {
194201
if #[cfg(not(freebsd13))] {
195202
pub const ELAST: ::c_int = 96;

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1154,6 +1154,15 @@ pub const UF_READONLY: ::c_ulong = 0x00001000;
11541154
pub const UF_HIDDEN: ::c_ulong = 0x00008000;
11551155
pub const SF_SNAPSHOT: ::c_ulong = 0x00200000;
11561156

1157+
pub const F_OGETLK: ::c_int = 7;
1158+
pub const F_OSETLK: ::c_int = 8;
1159+
pub const F_OSETLKW: ::c_int = 9;
1160+
pub const F_DUP2FD: ::c_int = 10;
1161+
pub const F_SETLK_REMOTE: ::c_int = 14;
1162+
pub const F_READAHEAD: ::c_int = 15;
1163+
pub const F_RDAHEAD: ::c_int = 16;
1164+
pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
1165+
11571166
fn _ALIGN(p: usize) -> usize {
11581167
(p + _ALIGNBYTES) & !_ALIGNBYTES
11591168
}

0 commit comments

Comments
 (0)