2 #include <sys/resource.h>
9 // Only query old priority if it can affect the result.
10 // This also avoids issues with integer overflow.
11 if (inc > -2*NZERO && inc < 2*NZERO)
12 prio += getpriority(PRIO_PROCESS, 0);
13 if (prio > NZERO-1) prio = NZERO-1;
14 if (prio < -NZERO) prio = -NZERO;
15 return setpriority(PRIO_PROCESS, 0, prio) ? -1 : prio;