3 #if defined(hpux) || defined(__hpux) || defined(_hpux)
4 # include <sys/pstat.h>
8 * By doing this in two steps we can at least get
9 * the function to be somewhat coherent, even
10 * with this disgusting nest of #ifdefs.
12 #ifndef _SC_NPROCESSORS_ONLN
13 # ifdef _SC_NPROC_ONLN
14 # define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
15 # elif defined _SC_CRAY_NCPU
16 # define _SC_NPROCESSORS_ONLN _SC_CRAY_NCPU
22 #ifdef _SC_NPROCESSORS_ONLN
30 if ((int)info.dwNumberOfProcessors > 0)
31 return (int)info.dwNumberOfProcessors;
32 #elif defined(hpux) || defined(__hpux) || defined(_hpux)
33 struct pst_dynamic psd;
35 if (!pstat_getdynamic(&psd, sizeof(psd), (size_t)1, 0))
36 return (int)psd.psd_proc_cnt;
39 #ifdef _SC_NPROCESSORS_ONLN
40 if ((ncpus = (long)sysconf(_SC_NPROCESSORS_ONLN)) > 0)