Skip to content

Commit cb24847

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 836cda9 commit cb24847

File tree

7 files changed

+14
-0
lines changed

7 files changed

+14
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
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
f! {
584586
pub fn sigemptyset(set: *mut sigset_t) -> ::c_int {
585587
*set = 0;

src/unix/notbsd/linux/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ pub const SYNC_FILE_RANGE_WAIT_BEFORE: ::c_uint = 1;
483483
pub const SYNC_FILE_RANGE_WRITE: ::c_uint = 2;
484484
pub const SYNC_FILE_RANGE_WAIT_AFTER: ::c_uint = 4;
485485

486+
pub const EAI_SYSTEM: ::c_int = -11;
487+
486488
f! {
487489
pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () {
488490
for slot in cpuset.bits.iter_mut() {

src/unix/solaris/mod.rs

Lines changed: 2 additions & 0 deletions
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)