summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Marie <semarie@users.noreply.github.com>2015-12-21 17:24:46 +0100
committerSébastien Marie <semarie@users.noreply.github.com>2015-12-23 11:03:13 +0100
commitee8c0500715a2476f17a31d1bbee125f75258d46 (patch)
treec0bc9d36b45c13b11d59abe54a426e3171d3544a
parent3de62ef5a7810b033a48793c831e2c1d43c5114a (diff)
downloadrust-libc-ee8c0500715a2476f17a31d1bbee125f75258d46.tar.gz
define NI_MAXHOST per system
- under openbsd/bitrig it is 256 - change type to `size_t` where system have `getnameinfo()` with `hostlen` as `size_t`
-rw-r--r--src/unix/bsd/apple/mod.rs2
-rw-r--r--src/unix/bsd/freebsdlike/mod.rs2
-rw-r--r--src/unix/bsd/mod.rs2
-rw-r--r--src/unix/bsd/openbsdlike/bitrig.rs2
-rw-r--r--src/unix/bsd/openbsdlike/netbsd.rs2
-rw-r--r--src/unix/bsd/openbsdlike/openbsd.rs2
6 files changed, 10 insertions, 2 deletions
diff --git a/src/unix/bsd/apple/mod.rs b/src/unix/bsd/apple/mod.rs
index 8383e25f8f..406acd1011 100644
--- a/src/unix/bsd/apple/mod.rs
+++ b/src/unix/bsd/apple/mod.rs
@@ -809,6 +809,8 @@ pub const VT1: ::c_int = 0x00010000;
pub const IUTF8: ::tcflag_t = 0x00004000;
pub const CRTSCTS: ::tcflag_t = 0x00030000;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+
extern {
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/src/unix/bsd/freebsdlike/mod.rs b/src/unix/bsd/freebsdlike/mod.rs
index 7ec8578ffa..d41829ceb2 100644
--- a/src/unix/bsd/freebsdlike/mod.rs
+++ b/src/unix/bsd/freebsdlike/mod.rs
@@ -557,6 +557,8 @@ pub const ST_NOSUID: ::c_ulong = 2;
pub const HW_AVAILCPU: ::c_int = 25;
+pub const NI_MAXHOST: ::size_t = 1025;
+
extern {
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/src/unix/bsd/mod.rs b/src/unix/bsd/mod.rs
index 361fa1e3f6..5dd890abb5 100644
--- a/src/unix/bsd/mod.rs
+++ b/src/unix/bsd/mod.rs
@@ -147,8 +147,6 @@ pub const IPV6_V6ONLY: ::c_int = 27;
pub const ST_RDONLY: ::c_ulong = 1;
-pub const NI_MAXHOST: ::socklen_t = 1025;
-
pub const CTL_HW: ::c_int = 6;
pub const HW_NCPU: ::c_int = 3;
diff --git a/src/unix/bsd/openbsdlike/bitrig.rs b/src/unix/bsd/openbsdlike/bitrig.rs
index 5b0635e051..ecb0bfdab9 100644
--- a/src/unix/bsd/openbsdlike/bitrig.rs
+++ b/src/unix/bsd/openbsdlike/bitrig.rs
@@ -217,6 +217,8 @@ pub const KERN_PROC_ARGS: ::c_int = 55;
pub const TMP_MAX : ::c_uint = 0x7fffffff;
+pub const NI_MAXHOST: ::size_t = 256;
+
extern {
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/src/unix/bsd/openbsdlike/netbsd.rs b/src/unix/bsd/openbsdlike/netbsd.rs
index 87e1655ca0..f2a10f4c7b 100644
--- a/src/unix/bsd/openbsdlike/netbsd.rs
+++ b/src/unix/bsd/openbsdlike/netbsd.rs
@@ -322,6 +322,8 @@ pub const CRTSCTS: ::tcflag_t = 0x00010000;
pub const TMP_MAX : ::c_uint = 308915776;
+pub const NI_MAXHOST: ::socklen_t = 1025;
+
extern {
pub fn getnameinfo(sa: *const ::sockaddr,
salen: ::socklen_t,
diff --git a/src/unix/bsd/openbsdlike/openbsd.rs b/src/unix/bsd/openbsdlike/openbsd.rs
index 897b5fbd75..e0dc826890 100644
--- a/src/unix/bsd/openbsdlike/openbsd.rs
+++ b/src/unix/bsd/openbsdlike/openbsd.rs
@@ -216,6 +216,8 @@ pub const KERN_PROC_ARGS: ::c_int = 55;
pub const TMP_MAX : ::c_uint = 0x7fffffff;
+pub const NI_MAXHOST: ::size_t = 256;
+
// syscall numbers
pub const SYS_getentropy: ::c_int = 7;