Add a function for fetching the RTTIME limit

We can use this to more easily diagnose issues caused by PipeWire.
This commit is contained in:
Robbert van der Helm
2021-05-27 13:48:34 +02:00
parent 4d5b2fcb12
commit 0d3850e837
2 changed files with 23 additions and 0 deletions
+9
View File
@@ -48,6 +48,15 @@ bool set_realtime_priority(bool sched_fifo, int priority) noexcept {
&params) == 0;
}
std::optional<rlim_t> get_rttime_limit() noexcept {
rlimit limits{};
if (getrlimit(RLIMIT_RTTIME, &limits) == 0) {
return limits.rlim_cur;
} else {
return std::nullopt;
}
}
bool pid_running(pid_t pid) {
// With regular individually hosted plugins we can simply check whether the
// process is still running, however Boost.Process does not allow you to do