Bitcoin Core  31.0.0
P2P Digital Currency
system.h
Go to the documentation of this file.
1 // Copyright (c) 2009-2010 Satoshi Nakamoto
2 // Copyright (c) 2009-present The Bitcoin Core 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 BITCOIN_COMMON_SYSTEM_H
7 #define BITCOIN_COMMON_SYSTEM_H
8 
9 #include <bitcoin-build-config.h> // IWYU pragma: keep
10 #include <util/time.h>
11 
12 #include <chrono>
13 #include <cstdint>
14 #include <optional>
15 #include <string>
16 
18 SteadyClock::duration GetUptime();
19 
20 void SetupEnvironment();
21 [[nodiscard]] bool SetupNetworking();
22 #ifndef WIN32
23 std::string ShellEscape(const std::string& arg);
24 #endif
25 #if HAVE_SYSTEM
26 void runCommand(const std::string& strCommand);
27 #endif
28 
33 int GetNumCores();
34 
38 std::optional<size_t> GetTotalRAM();
39 
40 #endif // BITCOIN_COMMON_SYSTEM_H
void SetupEnvironment()
Definition: system.cpp:64
std::optional< size_t > GetTotalRAM()
Return the total RAM available on the current system, if detectable.
Definition: system.cpp:114
SteadyClock::duration GetUptime()
Monotonic uptime (not affected by system time changes).
Definition: system.cpp:134
std::string ShellEscape(const std::string &arg)
Definition: system.cpp:41
int GetNumCores()
Return the number of cores available on the current system.
Definition: system.cpp:109
bool SetupNetworking()
Definition: system.cpp:97