Skip to content

Commit

Permalink
Added a note on how to allow non-root applications to increase their …
Browse files Browse the repository at this point in the history
…thread priority on Linux
  • Loading branch information
slouken committed Oct 13, 2016
1 parent 62310c6 commit 741aaf4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/thread/pthread/SDL_systhread.c
Expand Up @@ -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' <application>
*/
return SDL_SetError("setpriority() failed");
}
Expand Down

0 comments on commit 741aaf4

Please sign in to comment.