summary refs log tree commit diff
path: root/posix/sched_cpucount.c
diff options
context:
space:
mode:
Diffstat (limited to 'posix/sched_cpucount.c')
-rw-r--r--posix/sched_cpucount.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/posix/sched_cpucount.c b/posix/sched_cpucount.c
index 8404e8f3c0..d7f6b7b49f 100644
--- a/posix/sched_cpucount.c
+++ b/posix/sched_cpucount.c
@@ -21,10 +21,10 @@
 
 
 int
-__sched_cpucount (cpu_set_t *setp)
+__sched_cpucount (size_t setsize, cpu_set_t *setp)
 {
   int s = 0;
-  for (unsigned int j = 0; j < __CPU_SETSIZE / __NCPUBITS; ++j)
+  for (unsigned int j = 0; j < setsize / sizeof (__cpu_mask); ++j)
     {
       __cpu_mask l = setp->__bits[j];
       if (l == 0)