* sysconf.cc (sysconf): Return processors online rather than bitmask for
_SC_NPROCESSORS_ONLN.
This commit is contained in:
parent
03d65dd99b
commit
ab3dc80d9e
@ -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>
|
2003-07-08 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* cygheap.cc (creturn): Set appropriate errno when out of memory.
|
* cygheap.cc (creturn): Set appropriate errno when out of memory.
|
||||||
|
@ -90,7 +90,14 @@ sysconf (int in)
|
|||||||
case _SC_NPROCESSORS_CONF:
|
case _SC_NPROCESSORS_CONF:
|
||||||
return sbi.NumberProcessors;
|
return sbi.NumberProcessors;
|
||||||
case _SC_NPROCESSORS_ONLN:
|
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:
|
case _SC_PHYS_PAGES:
|
||||||
return sbi.NumberOfPhysicalPages;
|
return sbi.NumberOfPhysicalPages;
|
||||||
case _SC_AVPHYS_PAGES:
|
case _SC_AVPHYS_PAGES:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user