zstd: Implement core detection (#2083)

The bsdtar manual page claims that setting zstd:threads to 0 tells zstd
to use as many threads as there are cores in the system, but it actually
disables multi-threading.  Replace 0 with the number of configured
processors.

While here, add a previously missing overflow check.

Co-authored-by: Martin Matuska <martin@matuska.de>
This commit is contained in:
Dag-Erling SmørgravandMartin Matuska authored and Martin Matuska committed 2024-04-23 15:11:40 +02:00
1 parent a69a4537a6
commit 3efcadf886
5 files changed
+25 -9

No files matched your search

+3
View File
@@ -1094,6 +1094,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `symlink' function. */
#cmakedefine HAVE_SYMLINK 1
/* Define to 1 if you have the `sysconf' function. */
#cmakedefine HAVE_SYSCONF 1
/* Define to 1 if you have the <sys/acl.h> header file. */
#cmakedefine HAVE_SYS_ACL_H 1