From e67690f35a79ecf36dc6f03aab95965e4dd9939d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 14 Jun 2010 11:25:31 +0200 Subject: [PATCH] lscpu: add CPU_EQUAL_S definition for old/obscure libc Signed-off-by: Karel Zak --- include/cpuset.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/cpuset.h b/include/cpuset.h index 5f6b5bbf..64dab44e 100644 --- a/include/cpuset.h +++ b/include/cpuset.h @@ -38,6 +38,16 @@ & __CPUMASK (__cpu))) != 0 \ : 0; }) +# define CPU_EQUAL_S(setsize, cpusetp1, cpusetp2) \ + ({ __cpu_mask *__arr1 = (cpusetp1)->__bits; \ + __cpu_mask *__arr2 = (cpusetp2)->__bits; \ + size_t __imax = (setsize) / sizeof (__cpu_mask); \ + size_t __i; \ + for (__i = 0; __i < __imax; ++__i) \ + if (__bits[__i] != __bits[__i]) \ + break; \ + __i == __imax; }) + extern int __cpuset_count_s(size_t setsize, const cpu_set_t *set); # define CPU_COUNT_S(setsize, cpusetp) __cpuset_count_s(setsize, cpusetp) -- 2.39.5