On 09/27, Waiman Long wrote:
+static inline int sigequalsets(const sigset_t *set1, const sigset_t *set2)OK, this memcmp-by-hand matches other sig* helpers. Well, perhaps
+{
+ switch (_NSIG_WORDS) {
+ case 4:
+ return (set1->sig[3] == set2->sig[3])&&
+ (set1->sig[2] == set2->sig[2])&&
+ (set1->sig[1] == set2->sig[1])&&
+ (set1->sig[0] == set2->sig[0]);
+ case 2:
+ return (set1->sig[1] == set2->sig[1])&&
+ (set1->sig[0] == set2->sig[0]);
+ case 1:
+ return set1->sig[0] == set2->sig[0];
+ }
+ return 0;
+}
+
default:
BUILD_BUG();
makes sense too, but I won't insist.
Acked-by: Oleg Nesterov <oleg@xxxxxxxxxx>