From: Ian Lance Taylor Date: Tue, 24 May 2011 21:45:17 +0000 (+0000) Subject: libgo: Irix portability fixes (no declaration for getaddrinfo). X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=dd761d3aaf5724add090d6638191fa56f122782c;p=gcc.git libgo: Irix portability fixes (no declaration for getaddrinfo). From Rainer Orth. From-SVN: r174145 --- diff --git a/libgo/syscalls/socket_irix.go b/libgo/syscalls/socket_irix.go index 34190362c3f..e17f1642897 100644 --- a/libgo/syscalls/socket_irix.go +++ b/libgo/syscalls/socket_irix.go @@ -82,3 +82,44 @@ type IpMreq struct { Multiaddr [4]byte Interface [4]byte } + +// Similarly, only provides struct addrinfo, AI_* and EAI_* if +// _NO_XOPEN4 && _NO_XOPEN5. +type Addrinfo struct { + Ai_flags int32 + Ai_family int32 + Ai_socktype int32 + Ai_protocol int32 + Ai_addrlen int32 + Ai_canonname *uint8 + Ai_addr *_sockaddr + Ai_next *Addrinfo +} + +const ( + AI_PASSIVE = 0x00000001 + AI_CANONNAME = 0x00000002 + AI_NUMERICHOST = 0x00000004 + AI_NUMERICSERV = 0x00000008 + AI_ALL = 0x00000100 + AI_ADDRCONFIG = 0x00000400 + AI_V4MAPPED = 0x00000800 + AI_DEFAULT = (AI_V4MAPPED | AI_ADDRCONFIG) +) + +const ( + EAI_ADDRFAMILY = 1 + EAI_AGAIN = 2 + EAI_BADFLAGS = 3 + EAI_FAIL = 4 + EAI_FAMILY = 5 + EAI_MEMORY = 6 + EAI_NODATA = 7 + EAI_NONAME = 8 + EAI_SERVICE = 9 + EAI_SOCKTYPE = 10 + EAI_SYSTEM = 11 + EAI_BADHINTS = 12 + EAI_OVERFLOW = 13 + EAI_MAX = 14 +)