backout 29799f914cab, Bug 917642 - [Helix] Please update the helix blobs
[gecko.git] / other-licenses / android / resolv_static.h
blob82a3c96285c9250ff42ff3d3b46798d9801e4f2e
1 /*
2 * This version of this file is derived from Android 2.3 "Gingerbread",
3 * which contains uncredited changes by Android/Google developers. It has
4 * been modified in 2011 for use in the Android build of Mozilla Firefox by
5 * Mozilla contributors (including Michael Edwards <m.k.edwards@gmail.com>,
6 * and Steve Workman <sjhworkman@gmail.com>).
7 * These changes are offered under the same license as the original NetBSD
8 * file, whose copyright and license are unchanged above.
9 */
11 #ifndef _RESOLV_STATIC_H
12 #define _RESOLV_STATIC_H
14 #include <netdb.h>
16 /* this structure contains all the variables that were declared
17 * 'static' in the original NetBSD resolver code.
19 * this caused vast amounts of crashes and memory corruptions
20 * when the resolver was being used by multiple threads.
22 * (note: the OpenBSD/FreeBSD resolver has similar 'issues')
25 #define MAXALIASES 35
26 #define MAXADDRS 35
28 typedef struct res_static {
29 char* h_addr_ptrs[MAXADDRS + 1];
30 char* host_aliases[MAXALIASES];
31 char hostbuf[8*1024];
32 u_int32_t host_addr[16 / sizeof(u_int32_t)]; /* IPv4 or IPv6 */
33 FILE* hostf;
34 int stayopen;
35 const char* servent_ptr;
36 struct servent servent;
37 struct hostent host;
38 } *res_static;
40 extern res_static __res_get_static(void);
42 #endif /* _RESOLV_STATIC_H */