Changeset View
Changeset View
Standalone View
Standalone View
src/util.cpp
Show First 20 Lines • Show All 1,309 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
fs::path AbsPathForConfigVal(const fs::path &path, bool net_specific) { | fs::path AbsPathForConfigVal(const fs::path &path, bool net_specific) { | ||||
return fs::absolute(path, GetDataDir(net_specific)); | return fs::absolute(path, GetDataDir(net_specific)); | ||||
} | } | ||||
int ScheduleBatchPriority() { | int ScheduleBatchPriority() { | ||||
#ifdef SCHED_BATCH | #ifdef SCHED_BATCH | ||||
const static sched_param param{.sched_priority = 0}; | const static sched_param param{0}; | ||||
if (int ret = pthread_setschedparam(0, SCHED_BATCH, ¶m)) { | if (int ret = pthread_setschedparam(pthread_self(), SCHED_BATCH, ¶m)) { | ||||
LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno)); | LogPrintf("Failed to pthread_setschedparam: %s\n", strerror(errno)); | ||||
return ret; | return ret; | ||||
} | } | ||||
return 0; | return 0; | ||||
#else | #else | ||||
return 1; | return 1; | ||||
#endif | #endif | ||||
} | } |