Fix Cygwin build

This commit is contained in:
arancormonk
2025-09-07 10:13:03 -04:00
parent e2a6e351c5
commit a2a70bbb15

View File

@@ -1432,6 +1432,7 @@ static void maybe_set_thread_realtime_and_affinity(const char *role)
if (cpu_str && cpu_str[0] != '\0') {
int cpu = atoi(cpu_str);
if (cpu >= 0) {
#if defined(__linux__) && !defined(__CYGWIN__)
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET((unsigned)cpu, &cpuset);
@@ -1440,6 +1441,10 @@ static void maybe_set_thread_realtime_and_affinity(const char *role)
} else {
fprintf(stderr, "%s thread pinned to CPU %d.\n", role, cpu);
}
#else
(void)cpu;
fprintf(stderr, "NOTICE: CPU affinity not supported on this platform.\n");
#endif
}
}
}