Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2003-07-10 03:59:47 +0400
committerChristopher Faylor <me@cgf.cx>2003-07-10 03:59:47 +0400
commitab3dc80d9e4852a01e8fd1ff265e38aab1e06dd5 (patch)
treedc89c33a2de8f41fef599d207bc63186a9542095 /winsup/cygwin/sysconf.cc
parent03d65dd99ba593d2dab1a8151fa7766b650755ac (diff)
* sysconf.cc (sysconf): Return processors online rather than bitmask for
_SC_NPROCESSORS_ONLN.
Diffstat (limited to 'winsup/cygwin/sysconf.cc')
-rw-r--r--winsup/cygwin/sysconf.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/winsup/cygwin/sysconf.cc b/winsup/cygwin/sysconf.cc
index 944afdd41..760208adc 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: