Skip to content

Commit

Permalink
Add more FreeBSD-specific path open option constants
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Feb 11, 2023
1 parent 17adcf2 commit 196d497
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,12 @@ fn test_freebsd(target: &str) {
// These constants were introduced in FreeBSD 13:
"EFD_CLOEXEC" | "EFD_NONBLOCK" | "EFD_SEMAPHORE" if Some(13) > freebsd_ver => true,

// This constant was introduced in FreeBSD 12:
"O_RESOLVE_BENEATH" if Some(12) > freebsd_ver => true,

// These constants were introduced in FreeBSD 13:
"O_DSYNC" | "O_PATH" | "O_EMPTY_PATH" if Some(13) > freebsd_ver => true,

// FIXME: These are deprecated - remove in a couple of releases.
// These constants were removed in FreeBSD 11 (svn r273250) but will
// still be accepted and ignored at runtime.
Expand Down
6 changes: 6 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -819,14 +819,20 @@ ONOEOT
OXTABS
O_ASYNC
O_DIRECT
O_DSYNC
O_EMPTY_PATH
O_EXEC
O_EXLOCK
O_FSYNC
O_NDELAY
O_NOCTTY
O_PATH
O_RESOLVE_BENEATH
O_SEARCH
O_SHLOCK
O_SYNC
O_TTY_INIT
O_VERIFY
PD_ALLOWED_AT_FORK
PD_CLOEXEC
PD_DAEMON
Expand Down
6 changes: 6 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2461,8 +2461,14 @@ pub const SF_USER_READAHEAD: ::c_int = 0x00000008;
pub const SF_NOCACHE: ::c_int = 0x00000010;
pub const O_CLOEXEC: ::c_int = 0x00100000;
pub const O_DIRECTORY: ::c_int = 0x00020000;
pub const O_DSYNC: ::c_int = 0x01000000;
pub const O_EMPTY_PATH: ::c_int = 0x02000000;
pub const O_EXEC: ::c_int = 0x00040000;
pub const O_PATH: ::c_int = 0x00400000;
pub const O_RESOLVE_BENEATH: ::c_int = 0x00800000;
pub const O_SEARCH: ::c_int = O_EXEC;
pub const O_TTY_INIT: ::c_int = 0x00080000;
pub const O_VERIFY: ::c_int = 0x00200000;
pub const F_GETLK: ::c_int = 11;
pub const F_SETLK: ::c_int = 12;
pub const F_SETLKW: ::c_int = 13;
Expand Down

0 comments on commit 196d497

Please sign in to comment.