Bugzilla bug #25981: made PR_GetNumberOfProcessors() work on HP-UX 10
authorwtc%netscape.com
Fri, 26 May 2000 01:03:47 +0000
changeset 1383 40d95b3533c085a5209a9bea72bd8417472addc2
parent 1382 396213c071a6362949c38d62c9519668815819b0
child 1384 249b0c9e995e3a9c11a1cfef7190fa9e8fb08131
push idunknown
push userunknown
push dateunknown
bugs25981
Bugzilla bug #25981: made PR_GetNumberOfProcessors() work on HP-UX 10 and SINIX. Changed _SC_NPROC_CONF to _SC_NPROC_ONLN.
pr/src/misc/prsystem.c
--- a/pr/src/misc/prsystem.c
+++ b/pr/src/misc/prsystem.c
@@ -28,17 +28,16 @@
 #define INCL_DOS
 #include <os2.h>
 /* define the required constant if it is not already defined in the headers */
 #ifndef QSV_NUMPROCESSORS
 #define QSV_NUMPROCESSORS 26
 #endif
 
 #if defined(HPUX)
-#include <sys/scall_define.h>
 #include <sys/mp.h>
 #endif
 
 #if defined(XP_UNIX)
 #include <unistd.h>
 #include <sys/utsname.h>
 #endif
 
@@ -170,23 +169,23 @@ PR_IMPLEMENT(PRInt32) PR_GetNumberOfProc
     numCpus = MPProcessors();
 #elif defined(BEOS)
     system_info sysInfo;
 
     get_system_info(&sysInfo);
     numCpus = sysInfo.cpu_count;
 #elif defined(OS2)
     DosQuerySysInfo( QSV_NUMPROCESSORS, QSV_NUMPROCESSORS, &numCpus, sizeof(numCpus));
-#elif defined(HPUX11)
+#elif defined(HPUX)
     numCpus = mpctl( MPC_GETNUMSPUS, 0, 0 );
     if ( numCpus < 1 )  {
         numCpus = -1; /* set to -1 for return value on error */
         PR_SetError( PR_UNKNOWN_ERROR, _MD_ERRNO());
     }
-#elif defined(IRIX)
-    numCpus = sysconf( _SC_NPROC_CONF );
+#elif defined(IRIX) || defined(RELIANTUNIX)
+    numCpus = sysconf( _SC_NPROC_ONLN );
 #elif defined(XP_UNIX)
     numCpus = sysconf( _SC_NPROCESSORS_ONLN );
 #else
 #error "An implementation is required"
 #endif
     return(numCpus);
 } /* end PR_GetNumberOfProcessors() */