mirror of
https://github.com/robbert-vdh/yabridge.git
synced 2026-05-07 12:10:09 +02:00
Warn on startup if RLIMIT_MEMLOCK is set too low
This should diagnose issues like #119.
This commit is contained in:
@@ -57,6 +57,15 @@ bool set_realtime_priority(bool sched_fifo, int priority) noexcept {
|
||||
¶ms) == 0;
|
||||
}
|
||||
|
||||
std::optional<rlim_t> get_memlock_limit() noexcept {
|
||||
rlimit limits{};
|
||||
if (getrlimit(RLIMIT_MEMLOCK, &limits) == 0) {
|
||||
return limits.rlim_cur;
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
std::optional<rlim_t> get_rttime_limit() noexcept {
|
||||
rlimit limits{};
|
||||
if (getrlimit(RLIMIT_RTTIME, &limits) == 0) {
|
||||
|
||||
Reference in New Issue
Block a user