1From 2f90f8463423cfbb7e83fcef42f1071018c3b56e Mon Sep 17 00:00:00 2001 2From: Scott Murray <scott.murray@konsulko.com> 3Date: Fri, 13 Sep 2019 19:26:27 -0400 4Subject: [PATCH 13/22] Handle __cpu_mask usage 5 6Fixes errors: 7 8src/test/test-cpu-set-util.c:18:54: error: '__cpu_mask' undeclared (first use in this function) 9src/test/test-sizeof.c:73:14: error: '__cpu_mask' undeclared (first use in this function) 10 11__cpu_mask is an internal type of glibc's cpu_set implementation, not 12part of the POSIX definition, which is problematic when building with 13musl, which does not define a matching type. From inspection of musl's 14sched.h, however, it is clear that the corresponding type would be 15unsigned long, which does match glibc's actual __CPU_MASK_TYPE. So, 16add a typedef to cpu-set-util.h defining __cpu_mask appropriately. 17 18Upstream-Status: Inappropriate [musl specific] 19 20Signed-off-by: Scott Murray <scott.murray@konsulko.com> 21--- 22 src/shared/cpu-set-util.h | 2 ++ 23 src/test/test-sizeof.c | 2 +- 24 2 files changed, 3 insertions(+), 1 deletion(-) 25 26diff --git a/src/shared/cpu-set-util.h b/src/shared/cpu-set-util.h 27index 3c63a58826..4c2d4347fc 100644 28--- a/src/shared/cpu-set-util.h 29+++ b/src/shared/cpu-set-util.h 30@@ -6,6 +6,8 @@ 31 #include "macro.h" 32 #include "missing_syscall.h" 33 34+typedef unsigned long __cpu_mask; 35+ 36 /* This wraps the libc interface with a variable to keep the allocated size. */ 37 typedef struct CPUSet { 38 cpu_set_t *set; 39diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c 40index ea0c58770e..b65c0bd370 100644 41--- a/src/test/test-sizeof.c 42+++ b/src/test/test-sizeof.c 43@@ -1,6 +1,5 @@ 44 /* SPDX-License-Identifier: LGPL-2.1-or-later */ 45 46-#include <sched.h> 47 #include <stdio.h> 48 #include <string.h> 49 #include <sys/resource.h> 50@@ -12,6 +11,7 @@ 51 #include <float.h> 52 53 #include "time-util.h" 54+#include "cpu-set-util.h" 55 56 /* Print information about various types. Useful when diagnosing 57 * gcc diagnostics on an unfamiliar architecture. */ 58-- 592.34.1 60 61