diff --git a/libc-test/build.rs b/libc-test/build.rs index 3e443bb86e932..27b2962b29124 100644 --- a/libc-test/build.rs +++ b/libc-test/build.rs @@ -177,6 +177,7 @@ fn test_apple(target: &str) { headers! { cfg: "aio.h", + "arpa/inet.h", "CommonCrypto/CommonCrypto.h", "CommonCrypto/CommonRandom.h", "copyfile.h", @@ -192,6 +193,14 @@ fn test_apple(target: &str) { "grp.h", "iconv.h", "ifaddrs.h", + + "sys/types.h", + "sys/socket.h", + "sys/netinet/in.h", + "sys/arpa/inet.h", + "endian.h", + "libkern/OSByteOrder.h", + "sys/endian.h", "langinfo.h", "libgen.h", "libproc.h", diff --git a/libc-test/semver/unix.txt b/libc-test/semver/unix.txt index 5e84434b46bf4..d09dd1d83f1b8 100644 --- a/libc-test/semver/unix.txt +++ b/libc-test/semver/unix.txt @@ -583,6 +583,8 @@ grantpt group hostent hstrerror +htonl +htons if_indextoname if_nametoindex in6_addr @@ -651,6 +653,8 @@ munmap nanosleep nfds_t nlink_t +ntohl +ntohs off_t open opendir diff --git a/src/unix/mod.rs b/src/unix/mod.rs index 51984bc2c42c2..ef1086bd562e2 100644 --- a/src/unix/mod.rs +++ b/src/unix/mod.rs @@ -672,6 +672,10 @@ extern "C" { ) -> ::ssize_t; #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")] pub fn shutdown(socket: ::c_int, how: ::c_int) -> ::c_int; + pub fn htonl(hostlong: u32) -> u32; + pub fn htons(hostshort: u16) -> u16; + pub fn ntohl(netlong: u32) -> u32; + pub fn ntohs(netshort: u16) -> u16; #[cfg_attr( all(target_os = "macos", target_arch = "x86"),