summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Carlier <devnexen@gmail.com>2021-05-16 16:29:00 +0100
committerDavid Carlier <devnexen@gmail.com>2021-05-17 12:25:20 +0100
commit9e2a51e6a09bf06e6ba0e80f59a20e2a79583d6e (patch)
treefa7b1b566ca0a101d91c4336d1374f1f3ff02e81 /src
parent8580e972b57d5d55ddf5fb63b418ca484be934dc (diff)
downloadrust-libc-9e2a51e6a09bf06e6ba0e80f59a20e2a79583d6e.tar.gz
freebsd add realhostname api from libutil
Diffstat (limited to 'src')
-rw-r--r--src/unix/bsd/freebsdlike/freebsd/mod.rs13
1 files changed, 13 insertions, 0 deletions
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! {