Skip to content

Commit ee8c050

Browse files
committed
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`
1 parent 3de62ef commit ee8c050

File tree

6 files changed

+10
-2
lines changed

6 files changed

+10
-2
lines changed

src/unix/bsd/apple/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,8 @@ pub const VT1: ::c_int = 0x00010000;
809809
pub const IUTF8: ::tcflag_t = 0x00004000;
810810
pub const CRTSCTS: ::tcflag_t = 0x00030000;
811811

812+
pub const NI_MAXHOST: ::socklen_t = 1025;
813+
812814
extern {
813815
pub fn getnameinfo(sa: *const ::sockaddr,
814816
salen: ::socklen_t,

src/unix/bsd/freebsdlike/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ pub const ST_NOSUID: ::c_ulong = 2;
557557

558558
pub const HW_AVAILCPU: ::c_int = 25;
559559

560+
pub const NI_MAXHOST: ::size_t = 1025;
561+
560562
extern {
561563
pub fn getnameinfo(sa: *const ::sockaddr,
562564
salen: ::socklen_t,

src/unix/bsd/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,6 @@ pub const IPV6_V6ONLY: ::c_int = 27;
147147

148148
pub const ST_RDONLY: ::c_ulong = 1;
149149

150-
pub const NI_MAXHOST: ::socklen_t = 1025;
151-
152150
pub const CTL_HW: ::c_int = 6;
153151
pub const HW_NCPU: ::c_int = 3;
154152

src/unix/bsd/openbsdlike/bitrig.rs

+2
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ pub const KERN_PROC_ARGS: ::c_int = 55;
217217

218218
pub const TMP_MAX : ::c_uint = 0x7fffffff;
219219

220+
pub const NI_MAXHOST: ::size_t = 256;
221+
220222
extern {
221223
pub fn getnameinfo(sa: *const ::sockaddr,
222224
salen: ::socklen_t,

src/unix/bsd/openbsdlike/netbsd.rs

+2
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,8 @@ pub const CRTSCTS: ::tcflag_t = 0x00010000;
322322

323323
pub const TMP_MAX : ::c_uint = 308915776;
324324

325+
pub const NI_MAXHOST: ::socklen_t = 1025;
326+
325327
extern {
326328
pub fn getnameinfo(sa: *const ::sockaddr,
327329
salen: ::socklen_t,

src/unix/bsd/openbsdlike/openbsd.rs

+2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,8 @@ pub const KERN_PROC_ARGS: ::c_int = 55;
216216

217217
pub const TMP_MAX : ::c_uint = 0x7fffffff;
218218

219+
pub const NI_MAXHOST: ::size_t = 256;
220+
219221
// syscall numbers
220222
pub const SYS_getentropy: ::c_int = 7;
221223

0 commit comments

Comments
 (0)