Added a note on how to allow non-root applications to increase their thread priority on Linux
authorSam Lantinga <slouken@libsdl.org>
Wed, 12 Oct 2016 22:34:54 -0700
changeset 105248ede8e4e5b6f
parent 10523 a45d3b96cf85
child 10525 563503b6b4d1
Added a note on how to allow non-root applications to increase their thread priority on Linux
src/thread/pthread/SDL_systhread.c
     1.1 --- a/src/thread/pthread/SDL_systhread.c	Wed Oct 12 22:25:19 2016 -0700
     1.2 +++ b/src/thread/pthread/SDL_systhread.c	Wed Oct 12 22:34:54 2016 -0700
     1.3 @@ -199,6 +199,10 @@
     1.4      if (setpriority(PRIO_PROCESS, syscall(SYS_gettid), value) < 0) {
     1.5          /* Note that this fails if you're trying to set high priority
     1.6             and you don't have root permission. BUT DON'T RUN AS ROOT!
     1.7 +
     1.8 +           You can grant the ability to increase thread priority by
     1.9 +           running the following command on your application binary:
    1.10 +               sudo setcap 'cap_sys_nice=eip' <application>
    1.11           */
    1.12          return SDL_SetError("setpriority() failed");
    1.13      }