Sign in
android
/
platform
/
external
/
musl
/
3ea3fcf78a5532e118856846df8adbf3f60ef716
/
.
/
src
/
sched
/
sched_cpucount.c
blob: 94aa259e6ad5ed163038bb67b3de25e69f93a9ac [
file
] [
log
] [
blame
]
#define
_GNU_SOURCE
#include
<sched.h>
int
__sched_cpucount
(
size_t
size
,
const
cpu_set_t
*
set
)
{
size_t
i
,
j
,
cnt
=
0
;
const
unsigned
char
*
p
=
(
const
void
*)
set
;
for
(
i
=
0
;
i
<
size
;
i
++)
for
(
j
=
0
;
j
<
8
;
j
++)
if
(
p
[
i
]
&
(
1
<<
j
))
cnt
++;
return
cnt
;
}