2011-05-14 10:31:46 +02:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2023-10-16 14:18:28 +02:00
|
|
|
// Copyright (c) 2009-present The Bitcoin Core developers
|
2014-11-17 11:04:01 +08:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2012-05-18 22:02:28 +08:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
2013-04-13 00:13:08 -05:00
|
|
|
|
2023-05-08 11:32:13 +02:00
|
|
|
#ifndef BITCOIN_COMMON_SYSTEM_H
|
|
|
|
#define BITCOIN_COMMON_SYSTEM_H
|
2011-05-14 10:31:46 +02:00
|
|
|
|
2024-02-26 13:36:30 +01:00
|
|
|
#include <config/bitcoin-config.h> // IWYU pragma: keep
|
2013-04-13 00:13:08 -05:00
|
|
|
|
2023-10-16 14:18:28 +02:00
|
|
|
#include <cstdint>
|
2013-04-13 00:13:08 -05:00
|
|
|
#include <string>
|
2020-01-30 12:07:57 +01:00
|
|
|
|
2017-05-14 19:18:26 +01:00
|
|
|
// Application startup time (used for uptime calculation)
|
|
|
|
int64_t GetStartupTime();
|
|
|
|
|
2014-05-13 10:15:00 +00:00
|
|
|
void SetupEnvironment();
|
2023-11-28 19:11:52 +00:00
|
|
|
[[nodiscard]] bool SetupNetworking();
|
2018-05-29 14:37:53 +01:00
|
|
|
#ifndef WIN32
|
|
|
|
std::string ShellEscape(const std::string& arg);
|
|
|
|
#endif
|
2019-07-05 18:30:15 +02:00
|
|
|
#if HAVE_SYSTEM
|
2015-05-31 15:36:44 +02:00
|
|
|
void runCommand(const std::string& strCommand);
|
2019-03-14 11:30:37 +01:00
|
|
|
#endif
|
2011-05-14 10:31:46 +02:00
|
|
|
|
2015-07-01 17:38:15 +02:00
|
|
|
/**
|
2017-04-25 09:34:23 +08:00
|
|
|
* Return the number of cores available on the current system.
|
|
|
|
* @note This does count virtual cores, such as those provided by HyperThreading.
|
2015-07-01 17:38:15 +02:00
|
|
|
*/
|
|
|
|
int GetNumCores();
|
|
|
|
|
2023-05-08 11:32:13 +02:00
|
|
|
#endif // BITCOIN_COMMON_SYSTEM_H
|