aboutsummaryrefslogtreecommitdiffstats
path: root/sway/meson.build
diff options
context:
space:
mode:
authorLibravatar Rouven Czerwinski <rouven@czerwinskis.de>2022-05-13 20:30:19 +0200
committerLibravatar Kenny Levinsen <kl@kl.wtf>2022-05-18 11:20:17 +0200
commita3a82efbf6b5b3af840c70038b1b599ba29003ac (patch)
treefe28dbc19271b9dce54f7433a86bab0073fe8ca9 /sway/meson.build
parentserver: request xdg-shell v2 (diff)
downloadsway-a3a82efbf6b5b3af840c70038b1b599ba29003ac.tar.gz
sway-a3a82efbf6b5b3af840c70038b1b599ba29003ac.tar.zst
sway-a3a82efbf6b5b3af840c70038b1b599ba29003ac.zip
realtime: request SCHED_RR using CAP_SYS_NICE
Try to gain SCHED_RR (round-robin) realtime scheduling privileges before starting the server. This requires CAP_SYS_NICE on Linux systems. We additionally register a pthread_atfork callback which resets the scheduling class back to SCHED_OTHER (the Linux system default). Due to CAP_SYS_NICE, setting RLIMIT_RTPRIO has no effect on the process as documented within man 7 sched (from Linux): Privileged (CAP_SYS_NICE) threads ignore the RLIMIT_RTPRIO limit; as with older kernels, they can make arbitrary changes to scheduling policy and priority. See getrlimit(2) for further information on RLIMIT_RTPRIO Note that this requires the sway distribution packagers to set the CAP_SYS_NICE capability on the sway binary. Supersedes #6992
Diffstat (limited to 'sway/meson.build')
-rw-r--r--sway/meson.build1
1 files changed, 1 insertions, 0 deletions
diff --git a/sway/meson.build b/sway/meson.build
index 0ad783e3..6762ef2d 100644
--- a/sway/meson.build
+++ b/sway/meson.build
@@ -7,6 +7,7 @@ sway_sources = files(
7 'ipc-server.c', 7 'ipc-server.c',
8 'lock.c', 8 'lock.c',
9 'main.c', 9 'main.c',
10 'realtime.c',
10 'server.c', 11 'server.c',
11 'swaynag.c', 12 'swaynag.c',
12 'xdg_activation_v1.c', 13 'xdg_activation_v1.c',