diff options
author | bors <bors@rust-lang.org> | 2021-05-22 07:12:30 +0000 |
---|---|---|
committer | bors <bors@rust-lang.org> | 2021-05-22 07:12:30 +0000 |
commit | eae781ec9cd33059069f3302924a714c3fe2eb4b (patch) | |
tree | 946cf6157ca200e120635f2540354a574ecaca24 /src | |
parent | bd0994bd499d5a3ab6d38125f04cf7dc03300615 (diff) | |
parent | 9e2a51e6a09bf06e6ba0e80f59a20e2a79583d6e (diff) | |
download | rust-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.rs | 13 |
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! { |