From: Karel Zak Date: Mon, 14 Jun 2010 09:25:31 +0000 (+0200) Subject: lscpu: add CPU_EQUAL_S definition for old/obscure libc X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e67690f35a79ecf36dc6f03aab95965e4dd9939d;p=util-linux lscpu: add CPU_EQUAL_S definition for old/obscure libc Signed-off-by: Karel Zak --- 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)