other-licenses/android/resolv_static.h

Wed, 31 Dec 2014 06:55:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:50 +0100
changeset 2
7e26c7da4463
permissions
-rw-r--r--

Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2

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

mercurial