From c1bb668c5ea249186bf91065ba322c27bb532f91 Mon Sep 17 00:00:00 2001 From: Victor Lifagin Date: Tue, 13 Sep 2016 18:43:48 +0400 Subject: [PATCH] cpu_set should be constant by logic and by other distributions As I beleive __sched_cpucount should come with const, because it doesn't change it. This brokes build that holds cpu_count mask in a class and trying to use CPU_COUNT macro inside the constant method class Dummy { private: cpu_set_t mask; public: int get_cpu_count () const { return CPU_COUNT(&_mask); } }; PS sorry if I am proposing some stupid thing, but i checked, that it is like that in couple of modern linux distributions. --- libc/include/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/sched.h b/libc/include/sched.h index 930dd7c85..668fc9741 100644 --- a/libc/include/sched.h +++ b/libc/include/sched.h @@ -142,7 +142,7 @@ extern void __sched_cpufree(cpu_set_t* set); #define CPU_COUNT_S(setsize, set) __sched_cpucount((setsize), (set)) -extern int __sched_cpucount(size_t setsize, cpu_set_t* set); +extern int __sched_cpucount(size_t setsize, const cpu_set_t* set); #endif /* __USE_GNU */