Bugzilla Bug 261649: BeOS has the getprotobyxxx_r functions, but they
authorwtchang%redhat.com
Tue, 28 Feb 2006 00:03:51 +0000
changeset 3607 130807664953f9f24e269395c3935c9c32ac1833
parent 3597 701340cf3e27e3ea7ae08b753b2553ca0750762c
child 3609 924825f8a08b8f2e0d28547d9b6207ccc4b83bd2
push idunknown
push userunknown
push dateunknown
bugs261649
Bugzilla Bug 261649: BeOS has the getprotobyxxx_r functions, but they aren't glibc's 5-argument version.
pr/src/misc/prnetdb.c
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -77,19 +77,19 @@ extern int h_errno;
 #else
 PRLock *_pr_dnsLock = NULL;
 #define LOCK_DNS() PR_Lock(_pr_dnsLock)
 #define UNLOCK_DNS() PR_Unlock(_pr_dnsLock)
 #endif  /* defined(_PR_NO_DNS_LOCK) */
 
 /*
  * Some platforms have the reentrant getprotobyname_r() and
- * getprotobynumber_r().  However, they come in two flavors.
+ * getprotobynumber_r().  However, they come in three flavors.
  * Some return a pointer to struct protoent, others return
- * an int.
+ * an int, and glibc's flavor takes five arguments.
  */
 #if defined(XP_BEOS) && defined(BONE_VERSION)
 #include <arpa/inet.h>  /* pick up define for inet_addr */
 #include <sys/socket.h>
 #define _PR_HAVE_GETPROTO_R
 #define _PR_HAVE_GETPROTO_R_POINTER
 #endif
 
@@ -103,17 +103,18 @@ PRLock *_pr_dnsLock = NULL;
 #if defined(OSF1) \
         || defined(AIX4_3_PLUS) || (defined(AIX) && defined(_THREAD_SAFE)) \
 	|| (defined(HPUX10_10) && defined(_REENTRANT)) \
         || (defined(HPUX10_20) && defined(_REENTRANT))
 #define _PR_HAVE_GETPROTO_R
 #define _PR_HAVE_GETPROTO_R_INT
 #endif
 
-#if (defined(__GLIBC__) && __GLIBC__ >= 2)
+/* BeOS has glibc but not the glibc-style getprotobyxxx_r functions. */
+#if (defined(__GLIBC__) && __GLIBC__ >= 2 && !defined(XP_BEOS))
 #define _PR_HAVE_GETPROTO_R
 #define _PR_HAVE_5_ARG_GETPROTO_R
 #endif
 
 #if !defined(_PR_HAVE_GETPROTO_R)
 PRLock* _getproto_lock = NULL;
 #endif