diff options
author | Christopher Faylor <me@cgf.cx> | 2003-07-09 23:59:47 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-07-09 23:59:47 +0000 |
commit | ab3dc80d9e4852a01e8fd1ff265e38aab1e06dd5 (patch) | |
tree | dc89c33a2de8f41fef599d207bc63186a9542095 /winsup | |
parent | 03d65dd99ba593d2dab1a8151fa7766b650755ac (diff) | |
download | newlib-ab3dc80d9e4852a01e8fd1ff265e38aab1e06dd5.zip newlib-ab3dc80d9e4852a01e8fd1ff265e38aab1e06dd5.tar.gz newlib-ab3dc80d9e4852a01e8fd1ff265e38aab1e06dd5.tar.bz2 |
* sysconf.cc (sysconf): Return processors online rather than bitmask for
_SC_NPROCESSORS_ONLN.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/sysconf.cc | 9 |
2 files changed, 13 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index e860b36..47ee10b 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2003-07-09 Christopher Faylor <cgf@redhat.com> + + * sysconf.cc (sysconf): Return processors online rather than bitmask + for _SC_NPROCESSORS_ONLN. + 2003-07-08 Christopher Faylor <cgf@redhat.com> * cygheap.cc (creturn): Set appropriate errno when out of memory. diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc index 944afdd4..760208a 100644 --- a/winsup/cygwin/sysconf.cc +++ b/winsup/cygwin/sysconf.cc @@ -90,7 +90,14 @@ sysconf (int in) case _SC_NPROCESSORS_CONF: return sbi.NumberProcessors; case _SC_NPROCESSORS_ONLN: - return sbi.ActiveProcessors; + { + int i = 0; + do + if (sbi.ActiveProcessors & 1) + i++; + while (sbi.ActiveProcessors >>= 1); + return i; + } case _SC_PHYS_PAGES: return sbi.NumberOfPhysicalPages; case _SC_AVPHYS_PAGES: |