Changeset View
Changeset View
Standalone View
Standalone View
src/util/system.h
Show All 25 Lines | |||||
#include <atomic> | #include <atomic> | ||||
#include <cstdint> | #include <cstdint> | ||||
#include <exception> | #include <exception> | ||||
#include <map> | #include <map> | ||||
#include <set> | #include <set> | ||||
#include <string> | #include <string> | ||||
#include <unordered_set> | #include <unordered_set> | ||||
#include <utility> | |||||
#include <vector> | #include <vector> | ||||
// Application startup time (used for uptime calculation) | // Application startup time (used for uptime calculation) | ||||
int64_t GetStartupTime(); | int64_t GetStartupTime(); | ||||
extern const char *const BITCOIN_CONF_FILENAME; | extern const char *const BITCOIN_CONF_FILENAME; | ||||
extern const char *const BITCOIN_PID_FILENAME; | extern const char *const BITCOIN_PID_FILENAME; | ||||
▲ Show 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | |||||
inline void insert(Tdst &dst, const Tsrc &src) { | inline void insert(Tdst &dst, const Tsrc &src) { | ||||
dst.insert(dst.begin(), src.begin(), src.end()); | dst.insert(dst.begin(), src.begin(), src.end()); | ||||
} | } | ||||
template <typename TsetT, typename Tsrc> | template <typename TsetT, typename Tsrc> | ||||
inline void insert(std::set<TsetT> &dst, const Tsrc &src) { | inline void insert(std::set<TsetT> &dst, const Tsrc &src) { | ||||
dst.insert(src.begin(), src.end()); | dst.insert(src.begin(), src.end()); | ||||
} | } | ||||
#ifdef WIN32 | |||||
class WinCmdLineArgs { | |||||
public: | |||||
WinCmdLineArgs(); | |||||
~WinCmdLineArgs(); | |||||
std::pair<int, char **> get(); | |||||
private: | |||||
int argc; | |||||
char **argv; | |||||
std::vector<std::string> args; | |||||
}; | |||||
#endif | |||||
} // namespace util | } // namespace util | ||||
/** | /** | ||||
* On platforms that support it, tell the kernel the calling thread is | * On platforms that support it, tell the kernel the calling thread is | ||||
* CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details. | * CPU-intensive and non-interactive. See SCHED_BATCH in sched(7) for details. | ||||
* | * | ||||
* @return The return value of sched_setschedule(), or 1 on systems without | * @return The return value of sched_setschedule(), or 1 on systems without | ||||
* sched_setchedule(). | * sched_setchedule(). | ||||
*/ | */ | ||||
int ScheduleBatchPriority(); | int ScheduleBatchPriority(); | ||||
#endif // BITCOIN_UTIL_SYSTEM_H | #endif // BITCOIN_UTIL_SYSTEM_H |