PATCH: protect use of _SC_NPROCESSORS_ONLN

Loren James Rittle rittle@latour.rsch.comm.mot.com
Thu Aug 9 16:53:00 GMT 2001


I have been looking at getting libjava working on *-*-freebsd* again.
We don't define _SC_NPROCESSORS_ONLN.

	* java/lang/natObject.cc (is_mp): Protect use of _SC_NPROCESSORS_ONLN.

Index: java/lang/natObject.cc
===================================================================
RCS file: /cvs/gcc/egcs/libjava/java/lang/natObject.cc,v
retrieving revision 1.17
diff -c -r1.17 natObject.cc
*** natObject.cc	2001/07/23 03:51:17	1.17
--- natObject.cc	2001/08/09 23:49:14
***************
*** 436,443 ****
--- 436,447 ----
  static bool
  is_mp()
  {
+ #ifdef _SC_NPROCESSORS_ONLN
    long nprocs = sysconf(_SC_NPROCESSORS_ONLN);
    return (nprocs > 1);
+ #else
+   return false;
+ #endif
  }
  
  // A call to keep_live(p) forces p to be accessible to the GC



More information about the Java-patches mailing list