Bugzilla Bug 261649: BeOS has the getprotobyxxx_r functions, but they NSPRPUB_PRE_4_2_CLIENT_BRANCH THREADS_20060307_BASE
authorwtchang%redhat.com
Tue, 28 Feb 2006 00:00:48 +0000
branchNSPRPUB_PRE_4_2_CLIENT_BRANCH
changeset 3605 4bf6933947020149aa85188ac961e0af0a000ae1
parent 3596 5b60367337954648f57422b0a69433b1d5d5c676
child 3606 8c04288aeffbf0c19ae723daac58d577e9718190
child 3608 79852a54f67f42ecb16ccd3f994dd0f664f30718
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. Tag: NSPRPUB_PRE_4_2_CLIENT_BRANCH
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