Skip to content

Commit 5cf0cba

Browse files
committed
Auto merge of #2159 - coolreader18:redox-netdb, r=Amanieu
Add more netdb constants for redox
2 parents 66d8273 + d14c7c5 commit 5cf0cba

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

src/unix/redox/mod.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,25 @@ pub const O_SYMLINK: ::c_int = 0x4000_0000;
439439
pub const O_NOFOLLOW: ::c_int = -0x8000_0000;
440440

441441
// netdb.h
442+
pub const AI_PASSIVE: ::c_int = 0x0001;
443+
pub const AI_CANONNAME: ::c_int = 0x0002;
444+
pub const AI_NUMERICHOST: ::c_int = 0x0004;
445+
pub const AI_V4MAPPED: ::c_int = 0x0008;
446+
pub const AI_ALL: ::c_int = 0x0010;
447+
pub const AI_ADDRCONFIG: ::c_int = 0x0020;
448+
pub const AI_NUMERICSERV: ::c_int = 0x0400;
449+
pub const EAI_BADFLAGS: ::c_int = -1;
450+
pub const EAI_NONAME: ::c_int = -2;
451+
pub const EAI_AGAIN: ::c_int = -3;
452+
pub const EAI_FAIL: ::c_int = -4;
453+
pub const EAI_NODATA: ::c_int = -5;
454+
pub const EAI_FAMILY: ::c_int = -6;
455+
pub const EAI_SOCKTYPE: ::c_int = -7;
456+
pub const EAI_SERVICE: ::c_int = -8;
457+
pub const EAI_ADDRFAMILY: ::c_int = -9;
458+
pub const EAI_MEMORY: ::c_int = -10;
442459
pub const EAI_SYSTEM: ::c_int = -11;
460+
pub const EAI_OVERFLOW: ::c_int = -12;
443461
pub const NI_MAXHOST: ::c_int = 1025;
444462
pub const NI_MAXSERV: ::c_int = 32;
445463
pub const NI_NUMERICHOST: ::c_int = 0x0001;
@@ -945,6 +963,17 @@ extern "C" {
945963
// malloc.h
946964
pub fn memalign(align: ::size_t, size: ::size_t) -> *mut ::c_void;
947965

966+
// netdb.h
967+
pub fn getnameinfo(
968+
addr: *const ::sockaddr,
969+
addrlen: ::socklen_t,
970+
host: *mut ::c_char,
971+
hostlen: ::socklen_t,
972+
serv: *mut ::c_char,
973+
servlen: ::socklen_t,
974+
flags: ::c_int,
975+
) -> ::c_int;
976+
948977
// pthread.h
949978
pub fn pthread_atfork(
950979
prepare: ::Option<unsafe extern "C" fn()>,

0 commit comments

Comments
 (0)