michael@0: /* michael@0: * This version of this file is derived from Android 2.3 "Gingerbread", michael@0: * which contains uncredited changes by Android/Google developers. It has michael@0: * been modified in 2011 for use in the Android build of Mozilla Firefox by michael@0: * Mozilla contributors (including Michael Edwards , michael@0: * and Steve Workman ). michael@0: * These changes are offered under the same license as the original NetBSD michael@0: * file, whose copyright and license are unchanged above. michael@0: */ michael@0: michael@0: #ifndef _RESOLV_STATIC_H michael@0: #define _RESOLV_STATIC_H michael@0: michael@0: #include michael@0: michael@0: /* this structure contains all the variables that were declared michael@0: * 'static' in the original NetBSD resolver code. michael@0: * michael@0: * this caused vast amounts of crashes and memory corruptions michael@0: * when the resolver was being used by multiple threads. michael@0: * michael@0: * (note: the OpenBSD/FreeBSD resolver has similar 'issues') michael@0: */ michael@0: michael@0: #define MAXALIASES 35 michael@0: #define MAXADDRS 35 michael@0: michael@0: typedef struct res_static { michael@0: char* h_addr_ptrs[MAXADDRS + 1]; michael@0: char* host_aliases[MAXALIASES]; michael@0: char hostbuf[8*1024]; michael@0: u_int32_t host_addr[16 / sizeof(u_int32_t)]; /* IPv4 or IPv6 */ michael@0: FILE* hostf; michael@0: int stayopen; michael@0: const char* servent_ptr; michael@0: struct servent servent; michael@0: struct hostent host; michael@0: } *res_static; michael@0: michael@0: extern res_static __res_get_static(void); michael@0: michael@0: #endif /* _RESOLV_STATIC_H */