hardware_cputhreads.c 996 B

12345678910111213141516171819202122232425262728293031323334
  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. /// \file hardware_cputhreads.c
  4. /// \brief Get the number of CPU threads or cores
  5. //
  6. // Author: Lasse Collin
  7. //
  8. // This file has been put into the public domain.
  9. // You can do whatever you want with this file.
  10. //
  11. ///////////////////////////////////////////////////////////////////////////////
  12. #include "common.h"
  13. #include "tuklib_cpucores.h"
  14. #ifdef HAVE_SYMBOL_VERSIONS_LINUX
  15. // This is for compatibility with binaries linked against liblzma that
  16. // has been patched with xz-5.2.2-compat-libs.patch from RHEL/CentOS 7.
  17. LZMA_SYMVER_API("lzma_cputhreads@XZ_5.2.2",
  18. uint32_t, lzma_cputhreads_522)(void) lzma_nothrow
  19. __attribute__((__alias__("lzma_cputhreads_52")));
  20. LZMA_SYMVER_API("lzma_cputhreads@@XZ_5.2",
  21. uint32_t, lzma_cputhreads_52)(void) lzma_nothrow;
  22. #define lzma_cputhreads lzma_cputhreads_52
  23. #endif
  24. extern LZMA_API(uint32_t)
  25. lzma_cputhreads(void)
  26. {
  27. return tuklib_cpucores();
  28. }