Skip to content

Commit

Permalink
Auto merge of #3122 - valpackett:fbsd, r=JohnTitor
Browse files Browse the repository at this point in the history
FreeBSD: strchrnul, AT_EMPTY_PATH

- one related constant I missed in #3114
- since #3104 landed let's do that too (this function was available since FreeBSD 10)
  • Loading branch information
bors committed Feb 19, 2023
2 parents e401a59 + b6d5899 commit 9e3471a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libc-test/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2078,7 +2078,9 @@ fn test_freebsd(target: &str) {
"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,
"O_DSYNC" | "O_PATH" | "O_EMPTY_PATH" | "AT_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
Expand Down
2 changes: 2 additions & 0 deletions libc-test/semver/freebsd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ ATF_USETRAILERS
AT_BASE
AT_EACCESS
AT_EGID
AT_EMPTY_PATH
AT_ENTRY
AT_EUID
AT_EXECPATH
Expand Down Expand Up @@ -2109,6 +2110,7 @@ stack_t
statfs
strcasecmp
strcasestr
strchrnul
strncasecmp
strndup
strsignal
Expand Down
3 changes: 3 additions & 0 deletions src/unix/bsd/freebsdlike/freebsd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3737,6 +3737,7 @@ pub const AT_EACCESS: ::c_int = 0x100;
pub const AT_SYMLINK_NOFOLLOW: ::c_int = 0x200;
pub const AT_SYMLINK_FOLLOW: ::c_int = 0x400;
pub const AT_REMOVEDIR: ::c_int = 0x800;
pub const AT_EMPTY_PATH: ::c_int = 0x4000;

pub const AT_NULL: ::c_int = 0;
pub const AT_IGNORE: ::c_int = 1;
Expand Down Expand Up @@ -5249,6 +5250,8 @@ extern "C" {
rmtp: *mut ::timespec,
) -> ::c_int;

pub fn strchrnul(s: *const ::c_char, c: ::c_int) -> *mut ::c_char;

pub fn shm_create_largepage(
path: *const ::c_char,
flags: ::c_int,
Expand Down

0 comments on commit 9e3471a

Please sign in to comment.