[Gc] [PATCH] GNU/Hurd has sysconf(_SC_NPROCESSORS_ONLN)

Samuel Thibault samuel.thibault at ens-lyon.org
Wed Aug 15 13:14:37 PDT 2007


Hi,

GNU/Hurd also has sysconf(_SC_NPROCESSORS_ONLN), here is a patch.

Samuel
-------------- next part --------------
Index: pthread_support.c
===================================================================
RCS file: /cvsroot/bdwgc/bdwgc/pthread_support.c,v
retrieving revision 1.11
diff -u -p -r1.11 pthread_support.c
--- pthread_support.c	4 Aug 2007 05:59:28 -0000	1.11
+++ pthread_support.c	15 Aug 2007 20:12:44 -0000
@@ -763,7 +763,7 @@ void GC_thr_init(void)
 	  GC_nprocs = pthread_num_processors_np();
 #       endif
 #	if defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
-	   || defined(GC_SOLARIS_THREADS)
+	   || defined(GC_SOLARIS_THREADS) || defined(GC_GNU_THREADS)
 	  GC_nprocs = sysconf(_SC_NPROCESSORS_ONLN);
 	  if (GC_nprocs <= 0) GC_nprocs = 1;
 #	endif
@@ -783,9 +783,6 @@ void GC_thr_init(void)
 #	if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
           GC_nprocs = GC_get_nprocs();
 #	endif
-#       if defined(GC_GNU_THREADS)
-	  if (GC_nprocs <= 0) GC_nprocs = 1;
-#       endif
       }
       if (GC_nprocs <= 0) {
 	WARN("GC_get_nprocs() returned %ld\n", GC_nprocs);


More information about the Gc mailing list