19 #ifndef HWLOC_GLIBC_SCHED_H
20 #define HWLOC_GLIBC_SCHED_H
23 #include <hwloc/helper.h>
26 #if !defined _GNU_SOURCE || !defined _SCHED_H || (!defined CPU_SETSIZE && !defined sched_priority)
27 #error Please make sure to include sched.h before including glibc-sched.h, and define _GNU_SOURCE before any inclusion of sched.h
36 #ifdef HWLOC_HAVE_CPU_SET
51 static __hwloc_inline int
53 cpu_set_t *schedset, size_t schedsetsize)
57 CPU_ZERO_S(schedsetsize, schedset);
59 CPU_SET_S(cpu, schedsetsize, schedset);
64 assert(schedsetsize == sizeof(cpu_set_t));
66 CPU_SET(cpu, schedset);
79 static __hwloc_inline int
81 const cpu_set_t *schedset, size_t schedsetsize)
89 count = CPU_COUNT_S(schedsetsize, schedset);
92 if (CPU_ISSET_S(cpu, schedsetsize, schedset)) {
102 assert(schedsetsize == sizeof(cpu_set_t));
103 for(cpu=0; cpu<CPU_SETSIZE; cpu++)
104 if (CPU_ISSET(cpu, schedset))
|
|