From 741aaf4c80a4718d7496354ba842e90ba607de89 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Wed, 12 Oct 2016 22:34:54 -0700 Subject: [PATCH] Added a note on how to allow non-root applications to increase their thread priority on Linux --- src/thread/pthread/SDL_systhread.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/thread/pthread/SDL_systhread.c b/src/thread/pthread/SDL_systhread.c index 79d654375..05384ab73 100644 --- a/src/thread/pthread/SDL_systhread.c +++ b/src/thread/pthread/SDL_systhread.c @@ -199,6 +199,10 @@ SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) if (setpriority(PRIO_PROCESS, syscall(SYS_gettid), value) < 0) { /* Note that this fails if you're trying to set high priority and you don't have root permission. BUT DON'T RUN AS ROOT! + + You can grant the ability to increase thread priority by + running the following command on your application binary: + sudo setcap 'cap_sys_nice=eip' */ return SDL_SetError("setpriority() failed"); }