repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
fix mips setjmp/longjmp fpu state on r6, related issues
[musl.git]
/
src
/
sched
/
sched_cpucount.c
blob
94aa259e6ad5ed163038bb67b3de25e69f93a9ac
1
#define _GNU_SOURCE
2
#include <sched.h>
3
4
int
__sched_cpucount
(
size_t
size
,
const
cpu_set_t
*
set
)
5
{
6
size_t
i
,
j
,
cnt
=
0
;
7
const unsigned char
*
p
= (
const void
*)
set
;
8
for
(
i
=
0
;
i
<
size
;
i
++)
for
(
j
=
0
;
j
<
8
;
j
++)
9
if
(
p
[
i
] & (
1
<<
j
))
cnt
++;
10
return
cnt
;
11
}