153200025SRui Paulo ///////////////////////////////////////////////////////////////////////////////
253200025SRui Paulo //
353200025SRui Paulo /// \file       hardware_cputhreads.c
453200025SRui Paulo /// \brief      Get the number of CPU threads or cores
553200025SRui Paulo //
653200025SRui Paulo //  Author:     Lasse Collin
753200025SRui Paulo //
8*2f9cd13dSXin LI //  This file has been put into the public domain.
9*2f9cd13dSXin LI //  You can do whatever you want with this file.
10*2f9cd13dSXin LI //
1153200025SRui Paulo ///////////////////////////////////////////////////////////////////////////////
1253200025SRui Paulo 
1353200025SRui Paulo #include "common.h"
1453200025SRui Paulo 
1553200025SRui Paulo #include "tuklib_cpucores.h"
1653200025SRui Paulo 
1753200025SRui Paulo 
189e6bbe47SXin LI #ifdef HAVE_SYMBOL_VERSIONS_LINUX
199e6bbe47SXin LI // This is for compatibility with binaries linked against liblzma that
209e6bbe47SXin LI // has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7.
219e6bbe47SXin LI LZMA_SYMVER_API("lzma_cputhreads@XZ_5.2.2",
229e6bbe47SXin LI 	uint32_t, lzma_cputhreads_522)(void) lzma_nothrow
239e6bbe47SXin LI 		__attribute__((__alias__("lzma_cputhreads_52")));
249e6bbe47SXin LI 
259e6bbe47SXin LI LZMA_SYMVER_API("lzma_cputhreads@@XZ_5.2",
269e6bbe47SXin LI 	uint32_t, lzma_cputhreads_52)(void) lzma_nothrow;
279e6bbe47SXin LI 
289e6bbe47SXin LI #define lzma_cputhreads lzma_cputhreads_52
299e6bbe47SXin LI #endif
3053200025SRui Paulo extern LZMA_API(uint32_t)
lzma_cputhreads(void)3153200025SRui Paulo lzma_cputhreads(void)
3253200025SRui Paulo {
3353200025SRui Paulo 	return tuklib_cpucores();
3453200025SRui Paulo }
35