aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/sched.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2023-08-30 11:32:02 +0200
committerCorinna Vinschen <corinna@vinschen.de>2023-09-01 12:38:52 +0200
commitd27e9fb29a92fc5984de51470d68d859783ab986 (patch)
tree2d564a5632c8304fcc22072eb5b4be8d0163af50 /winsup/cygwin/sched.cc
parentcc4ff714ff4b59d8ecac90ddc45196a0ea74e22b (diff)
downloadnewlib-d27e9fb29a92fc5984de51470d68d859783ab986.zip
newlib-d27e9fb29a92fc5984de51470d68d859783ab986.tar.gz
newlib-d27e9fb29a92fc5984de51470d68d859783ab986.tar.bz2
Cygwin: sys/cpuset.h: add cpuset-specific external functions
The latest incarnation of sys/cpuset.h broke building coreutils. The reason is the inclusion of stdlib.h and string.h and hence premature requests for datatypes not yet defined in the include chain. Avoid this by defining __cpuset_alloc and __cpuset_free as external functions, now defined in sched.cc. Linux is doing this too, just using different names for the functions. Redefine __cpuset_zero_s to use __builtin_memset only on compilers supporting it, otherwise using a simple loop. Drop the stdlib.h and string.h includes. Fixes: 3f2790e04439 ("Cygwin: Make gcc-specific code in <sys/cpuset.h> compiler-agnostic") Reported-by: Denis Excoffier <cygwin@Denis-Excoffier.org> Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/sched.cc')
-rw-r--r--winsup/cygwin/sched.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/winsup/cygwin/sched.cc b/winsup/cygwin/sched.cc
index d7bad85..845fcef 100644
--- a/winsup/cygwin/sched.cc
+++ b/winsup/cygwin/sched.cc
@@ -684,4 +684,16 @@ done:
return 0;
}
+cpu_set_t *
+__cpuset_alloc (int num)
+{
+ return (cpu_set_t *) malloc (CPU_ALLOC_SIZE(num));
+}
+
+void
+__cpuset_free (cpu_set_t *set)
+{
+ free (set);
+}
+
} /* extern C */