From eeb0328f203cfb8990b3eee5ee31d931fc539ceb Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 10 Aug 2013 21:15:11 -0400 Subject: add cpu affinity interfaces this first commit just includes the CPU_* and sched_* interfaces, not the pthread_* interfaces, which may be added later. simple sanity-check testing has been done for the basic interfaces, but most of the macros have not yet been tested. --- src/sched/sched_cpucount.c | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 src/sched/sched_cpucount.c (limited to 'src/sched/sched_cpucount.c') diff --git a/src/sched/sched_cpucount.c b/src/sched/sched_cpucount.c new file mode 100644 index 00000000..94aa259e --- /dev/null +++ b/src/sched/sched_cpucount.c @@ -0,0 +1,11 @@ +#define _GNU_SOURCE +#include + +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