Skip to content

Commit 9e2a51e

Browse files
committed
freebsd add realhostname api from libutil
1 parent 8580e97 commit 9e2a51e

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

libc-test/semver/freebsd.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,10 @@ GLOB_NOMATCH
327327
GLOB_NOSORT
328328
GLOB_NOSPACE
329329
H4DISC
330+
HOSTNAME_FOUND
331+
HOSTNAME_INCORRECTNAME
332+
HOSTNAME_INVALIDADDR
333+
HOSTNAME_INVALIDNAME
330334
HW_BYTEORDER
331335
HW_DISKNAMES
332336
HW_DISKSTATS
@@ -1551,6 +1555,8 @@ querylocale
15511555
rand
15521556
readdir_r
15531557
readlinkat
1558+
realhostname
1559+
realhostname_sa
15541560
recvmmsg
15551561
recvmsg
15561562
regcomp

src/unix/bsd/freebsdlike/freebsd/mod.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,12 @@ pub const F_READAHEAD: ::c_int = 15;
12281228
pub const F_RDAHEAD: ::c_int = 16;
12291229
pub const F_DUP2FD_CLOEXEC: ::c_int = 18;
12301230

1231+
// For realhostname* api
1232+
pub const HOSTNAME_FOUND: ::c_int = 0;
1233+
pub const HOSTNAME_INCORRECTNAME: ::c_int = 1;
1234+
pub const HOSTNAME_INVALIDADDR: ::c_int = 2;
1235+
pub const HOSTNAME_INVALIDNAME: ::c_int = 3;
1236+
12311237
const_fn! {
12321238
{const} fn _ALIGN(p: usize) -> usize {
12331239
(p + _ALIGNBYTES) & !_ALIGNBYTES
@@ -1612,6 +1618,13 @@ extern "C" {
16121618
string: *const ::c_char,
16131619
attrnamespace: *mut ::c_int,
16141620
) -> ::c_int;
1621+
pub fn realhostname(host: *mut ::c_char, hsize: ::size_t, ip: *const ::in_addr) -> ::c_int;
1622+
pub fn realhostname_sa(
1623+
host: *mut ::c_char,
1624+
hsize: ::size_t,
1625+
addr: *mut ::sockaddr,
1626+
addrlen: ::c_int,
1627+
) -> ::c_int;
16151628
}
16161629

16171630
cfg_if! {

0 commit comments

Comments
 (0)