Bug 754649: Add support for Hurd. The patch is contributed by Mike Hommey
authorwtc%google.com
Fri, 18 May 2012 21:55:29 +0000
changeset 4387 56b84142d57989764c331dc59dcbd69b7f61da3a
parent 4386 6f5c6760c899d025776de5bfb6633b7df8fd83d3
child 4388 ace10674ab000a30941e544e6825b589874edfb7
push idunknown
push userunknown
push dateunknown
bugs754649
Bug 754649: Add support for Hurd. The patch is contributed by Mike Hommey <mh+mozilla@glandium.org>. r=wtc. Modified Files: _linux.cfg _pth.h uxrng.c
pr/include/md/_linux.cfg
pr/include/md/_pth.h
pr/src/md/unix/uxrng.c
--- a/pr/include/md/_linux.cfg
+++ b/pr/include/md/_linux.cfg
@@ -16,16 +16,18 @@
 #endif
 
 #if !defined(LINUX) && defined(__linux__)
 #define LINUX
 #endif
 
 #ifdef __FreeBSD_kernel__
 #define PR_AF_INET6 28  /* same as AF_INET6 */
+#elif defined(__GNU__)
+#define PR_AF_INET6 26  /* same as AF_INET6 */
 #else
 #define PR_AF_INET6 10  /* same as AF_INET6 */
 #endif
 
 #ifdef __powerpc64__
 
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN    1
--- a/pr/include/md/_pth.h
+++ b/pr/include/md/_pth.h
@@ -113,20 +113,16 @@
 	(!memcmp(&(t), &pt_zero_tid, sizeof(pthread_t)))
 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
 #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
 	|| defined(LINUX) || defined(__GNU__) || defined(__GLIBC__) \
 	|| defined(HPUX) || defined(FREEBSD) \
 	|| defined(NETBSD) || defined(OPENBSD) || defined(BSDI) \
 	|| defined(NTO) || defined(DARWIN) \
 	|| defined(UNIXWARE) || defined(RISCOS)	|| defined(SYMBIAN)
-#ifdef __GNU__
-/* Hurd pthreads don't have an invalid value for pthread_t. -- rmh */
-#error Using Hurd pthreads
-#endif
 #define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = 0
 #define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t)  (t) == 0
 #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
 #else 
 #error "pthreads is not supported for this architecture"
 #endif
 
 #if defined(_PR_DCETHREADS)
--- a/pr/src/md/unix/uxrng.c
+++ b/pr/src/md/unix/uxrng.c
@@ -89,17 +89,17 @@ GetHighResClock(void *buf, size_t maxbyt
 static size_t
 GetHighResClock(void *buf, size_t maxbytes)
 {
     return 0;
 }
 
 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
     || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD) \
-    || defined(SYMBIAN))
+    || defined(SYMBIAN) || defined(__GNU__))
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 
 static int      fdDevURandom;
 static PRCallOnceType coOpenDevURandom;
 
 static PRStatus OpenDevURandom( void )