summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-05-22 07:12:30 +0000
committerbors <bors@rust-lang.org>2021-05-22 07:12:30 +0000
commiteae781ec9cd33059069f3302924a714c3fe2eb4b (patch)
tree946cf6157ca200e120635f2540354a574ecaca24 /src
parentbd0994bd499d5a3ab6d38125f04cf7dc03300615 (diff)
parent9e2a51e6a09bf06e6ba0e80f59a20e2a79583d6e (diff)
downloadrust-libc-eae781ec9cd33059069f3302924a714c3fe2eb4b.tar.gz
Auto merge of #2182 - devnexen:fbsd_libutil_upd, r=JohnTitor
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! {