1 $NetBSD: patch-ae,v 1.8 2011/11/13 16:59:58 tnn Exp $
3 --- mozilla/nsprpub/pr/src/misc/prnetdb.c.orig 2012-02-16 10:25:22.000000000 +0000
4 +++ mozilla/nsprpub/pr/src/misc/prnetdb.c
5 @@ -105,7 +105,7 @@ PRLock *_pr_dnsLock = NULL;
6 || defined(AIX4_3_PLUS) || (defined(AIX) && defined(_THREAD_SAFE)) \
7 || (defined(HPUX10_10) && defined(_REENTRANT)) \
8 || (defined(HPUX10_20) && defined(_REENTRANT)) \
10 + || defined(OPENBSD) || defined(NETBSD)
11 #define _PR_HAVE_GETPROTO_R
12 #define _PR_HAVE_GETPROTO_R_INT
14 @@ -115,6 +115,11 @@ PRLock *_pr_dnsLock = NULL;
15 #define _PR_HAVE_5_ARG_GETPROTO_R
18 +#if __DragonFly_version >= 200202
19 +#define _PR_HAVE_GETPROTO_R
20 +#define _PR_HAVE_5_ARG_GETPROTO_R
23 /* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
24 #if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
25 #define _PR_HAVE_GETPROTO_R
26 @@ -332,7 +337,7 @@ _pr_QueryNetIfs(void)
29 #elif (defined(DARWIN) && defined(HAVE_GETIFADDRS)) || defined(FREEBSD) \
30 - || defined(NETBSD) || defined(OPENBSD)
31 + || defined(NETBSD) || defined(OPENBSD) || defined(DRAGONFLY)
34 * Use the BSD getifaddrs function.
35 @@ -2076,6 +2081,11 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
37 hints.ai_socktype = SOCK_STREAM;
39 +/* NetBSD >= 2.99.9 has a thread-safe resolver */
40 +#if defined(__NetBSD_Version__) && __NetBSD_Version__ < 299000900
44 rv = GETADDRINFO(hostname, NULL, &hints, &res);
46 if (rv == EAI_BADFLAGS && (hints.ai_flags & AI_ADDRCONFIG)) {
47 @@ -2083,6 +2093,11 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInf
48 rv = GETADDRINFO(hostname, NULL, &hints, &res);
52 +#if defined(__NetBSD_Version__) && __NetBSD_Version__ < 299000900
57 return (PRAddrInfo *) res;