From d0dcaf56c23d5691625b0b02ff106f08baa79f9c Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Wed, 8 Jan 2020 00:48:26 +0100 Subject: [PATCH] Make UTIL_countPhysicalCores() work under Cygwin (#1941) Cygwin currently uses the fallback implementation which just returns 1 every time, which leads to bad performance when zstd is called with -T0 for example. Instead use the POSIX implementation used for the BSDs which works just fine under Cygwin. Tested under Cygwin and MSYS2. --- programs/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/programs/util.c b/programs/util.c index 51d84801..399507c2 100644 --- a/programs/util.c +++ b/programs/util.c @@ -903,7 +903,7 @@ int UTIL_countPhysicalCores(void) return numPhysicalCores; } -#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) +#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__CYGWIN__) /* Use POSIX sysconf * see: man 3 sysconf */