Commit e13e3c02ad0c
tarball1 file changed+11-0
@@ -148,7 +148,18 @@ fn main() -> ExitCode {
148148
149149
/// Puts the compositor thread on SCHED_RR so a busy desktop cannot delay a150150
/// frame. Reset-on-fork keeps threads and programs it starts off realtime.151
+/// The NixOS capability wrapper raises CAP_SYS_NICE as an ambient capability,152
+/// which every launched program would inherit unless cleared.151153
fn realtime() {154
+ unsafe {155
+ libc::prctl(156
+ libc::PR_CAP_AMBIENT,157
+ libc::PR_CAP_AMBIENT_CLEAR_ALL,158
+ 0,159
+ 0,160
+ 0,161
+ )162
+ };152163
let param = libc::sched_param { sched_priority: 2 };153164
// SAFETY: plain syscall on the calling thread with a valid param.154165
let rc =