2011-05-14 10:31:46 +02:00
|
|
|
// Copyright (c) 2009-2010 Satoshi Nakamoto
|
2022-12-24 23:49:50 +00:00
|
|
|
// Copyright (c) 2009-2022 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
|
|
|
|
2018-10-22 15:51:11 -07:00
|
|
|
#ifndef BITCOIN_UTIL_SYSTEM_H
|
|
|
|
#define BITCOIN_UTIL_SYSTEM_H
|
2011-05-14 10:31:46 +02:00
|
|
|
|
2013-04-13 00:13:08 -05:00
|
|
|
#if defined(HAVE_CONFIG_H)
|
2017-11-10 13:57:53 +13:00
|
|
|
#include <config/bitcoin-config.h>
|
2013-04-13 00:13:08 -05:00
|
|
|
#endif
|
|
|
|
|
2019-02-11 23:52:59 +01:00
|
|
|
#include <compat/assumptions.h>
|
2023-03-15 11:18:06 +01:00
|
|
|
#include <compat/compat.h>
|
2011-05-14 10:31:46 +02:00
|
|
|
|
2018-04-04 18:06:00 +10:00
|
|
|
#include <set>
|
2013-04-13 00:13:08 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
#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();
|
2015-09-02 16:18:16 +02:00
|
|
|
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();
|
|
|
|
|
2018-10-22 15:51:11 -07:00
|
|
|
#endif // BITCOIN_UTIL_SYSTEM_H
|