diff options
-rw-r--r-- | libc-test/semver/freebsd.txt | 6 | ||||
-rw-r--r-- | src/unix/bsd/freebsdlike/freebsd/mod.rs | 13 |
2 files changed, 19 insertions, 0 deletions
diff --git a/libc-test/semver/freebsd.txt b/libc-test/semver/freebsd.txt index 6433821b50..b7735db707 100644 --- a/libc-test/semver/freebsd.txt +++ b/libc-test/semver/freebsd.txt @@ -327,6 +327,10 @@ GLOB_NOMATCH GLOB_NOSORT GLOB_NOSPACE H4DISC +HOSTNAME_FOUND +HOSTNAME_INCORRECTNAME +HOSTNAME_INVALIDADDR +HOSTNAME_INVALIDNAME HW_BYTEORDER HW_DISKNAMES HW_DISKSTATS @@ -1551,6 +1555,8 @@ querylocale rand readdir_r readlinkat +realhostname +realhostname_sa recvmmsg recvmsg regcomp diff --git a/src/unix/bsd/freebsdlike/freebsd/mod.rs b/src/unix/bsd/freebsdlike/freebsd/mod.rs index 042bec19c5..9a64dc39fd 100644 --- a/src/unix/bsd/freebsdlike/freebsd/mod.rs +++ b/src/unix/bsd/freebsdlike/freebsd/mod.rs @@ -1228,6 +1228,12 @@ pub const F_READAHEAD: ::c_int = 15; pub const F_RDAHEAD: ::c_int = 16; pub const F_DUP2FD_CLOEXEC: ::c_int = 18; +// For realhostname* api +pub const HOSTNAME_FOUND: ::c_int = 0; +pub const HOSTNAME_INCORRECTNAME: ::c_int = 1; +pub const HOSTNAME_INVALIDADDR: ::c_int = 2; +pub const HOSTNAME_INVALIDNAME: ::c_int = 3; + const_fn! { {const} fn _ALIGN(p: usize) -> usize { (p + _ALIGNBYTES) & !_ALIGNBYTES @@ -1612,6 +1618,13 @@ extern "C" { string: *const ::c_char, attrnamespace: *mut ::c_int, ) -> ::c_int; + pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int; + pub fn realhostname_sa( + host: *mut ::c_char, + hsize: ::size_t, + addr: *mut ::sockaddr, + addrlen: ::c_int, + ) -> ::c_int; } cfg_if! { |