system.h raw

   1  // Copyright (c) 2009-2010 Satoshi Nakamoto
   2  // Copyright (c) 2009-present The Limenka developers
   3  // Distributed under the MIT software license, see the accompanying
   4  // file COPYING or http://www.opensource.org/licenses/mit-license.php.
   5  
   6  #ifndef LIMENKA_COMMON_SYSTEM_H
   7  #define LIMENKA_COMMON_SYSTEM_H
   8  
   9  #include <limenka-build-config.h> // IWYU pragma: keep
  10  #include <util/time.h>
  11  
  12  #include <cstdint>
  13  #include <string>
  14  
  15  /// Monotonic uptime (not affected by system time changes).
  16  SteadyClock::duration GetUptime();
  17  
  18  void SetupEnvironment();
  19  [[nodiscard]] bool SetupNetworking();
  20  #if HAVE_SYSTEM
  21  void runCommand(const std::string& strCommand);
  22  #endif
  23  
  24  /**
  25   * Return the number of cores available on the current system.
  26   * @note This does count virtual cores, such as those provided by HyperThreading.
  27   */
  28  int GetNumCores();
  29  
  30  #endif // LIMENKA_COMMON_SYSTEM_H
  31