Skip to content

Commit f514d46

Browse files
committed
Add EAI_SYSTEM getaddrinfo error code.
This is useful to decide if value returned from getaddrinfo is actual error or you should look at errno instead.
1 parent 4548dc6 commit f514d46

File tree

7 files changed

+14
-0
lines changed

7 files changed

+14
-0
lines changed

src/unix/bsd/apple/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -621,6 +621,8 @@ pub const EOWNERDEAD: ::c_int = 105;
621621
pub const EQFULL: ::c_int = 106;
622622
pub const ELAST: ::c_int = 106;
623623

624+
pub const EAI_SYSTEM: ::c_int = 11;
625+
624626
pub const F_DUPFD: ::c_int = 0;
625627
pub const F_DUPFD_CLOEXEC: ::c_int = 67;
626628
pub const F_GETFD: ::c_int = 1;

src/unix/bsd/freebsdlike/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,8 @@ pub const EMULTIHOP: ::c_int = 90;
467467
pub const ENOLINK: ::c_int = 91;
468468
pub const EPROTO: ::c_int = 92;
469469

470+
pub const EAI_SYSTEM: ::c_int = 11;
471+
470472
pub const F_DUPFD: ::c_int = 0;
471473
pub const F_GETFD: ::c_int = 1;
472474
pub const F_SETFD: ::c_int = 2;

src/unix/bsd/netbsdlike/netbsd.rs

+2
Original file line numberDiff line numberDiff line change
@@ -547,6 +547,8 @@ pub const KERN_PROC_RUID: ::c_int = 6;
547547
pub const KERN_PROC_GID: ::c_int = 7;
548548
pub const KERN_PROC_RGID: ::c_int = 8;
549549

550+
pub const EAI_SYSTEM: ::c_int = 11;
551+
550552
extern {
551553
pub fn lutimes(file: *const ::c_char, times: *const ::timeval) -> ::c_int;
552554
pub fn getnameinfo(sa: *const ::sockaddr,

src/unix/bsd/netbsdlike/openbsdlike/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ pub const EIPSEC : ::c_int = 82;
172172
pub const ENOMEDIUM : ::c_int = 85;
173173
pub const EMEDIUMTYPE : ::c_int = 86;
174174

175+
pub const EAI_SYSTEM: ::c_int = -11;
176+
175177
pub const RUSAGE_THREAD: ::c_int = 1;
176178

177179
pub const MAP_COPY : ::c_int = 0x0002;

src/unix/notbsd/android/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,8 @@ pub const ICANON: ::tcflag_t = 0x00000002;
580580
pub const PENDIN: ::tcflag_t = 0x00004000;
581581
pub const NOFLSH: ::tcflag_t = 0x00000080;
582582

583+
pub const EAI_SYSTEM: ::c_int = 11;
584+
583585
pub const NETLINK_ROUTE: ::c_int = 0;
584586
pub const NETLINK_UNUSED: ::c_int = 1;
585587
pub const NETLINK_USERSOCK: ::c_int = 2;

src/unix/notbsd/linux/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
504504
pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
505505
pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
506506

507+
pub const EAI_SYSTEM: ::c_int = -11;
508+
507509
f! {
508510
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
509511
for slot in cpuset.bits.iter_mut() {

src/unix/solaris/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,8 @@ pub const EMULTIHOP: ::c_int = 74;
651651
pub const ENOLINK: ::c_int = 67;
652652
pub const EPROTO: ::c_int = 71;
653653

654+
pub const EAI_SYSTEM: ::cc_int = 11;
655+
654656
pub const F_DUPFD: ::c_int = 0;
655657
pub const F_GETFD: ::c_int = 1;
656658
pub const F_SETFD: ::c_int = 2;

0 commit comments

Comments
 (0)