]> err.no Git - util-linux/commitdiff
lscpu: add CPU_EQUAL_S definition for old/obscure libc
authorKarel Zak <kzak@redhat.com>
Mon, 14 Jun 2010 09:25:31 +0000 (11:25 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 14 Jun 2010 09:25:31 +0000 (11:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
include/cpuset.h

index 5f6b5bbf69ee7678051b695b3c079ac4492bde57..64dab44ebc7563db96120b06a64fa65240f738db 100644 (file)
          & __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)