From: Christoph Reiter Date: Tue, 7 Jan 2020 23:48:26 +0000 (+0100) Subject: Make UTIL_countPhysicalCores() work under Cygwin (#1941) X-Git-Tag: v1.4.5^2~122 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0dcaf56c23d5691625b0b02ff106f08baa79f9c;p=thirdparty%2Fzstd.git 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. --- diff --git a/programs/util.c b/programs/util.c index 51d848018..399507c2a 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 */