End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Process.setpriority
Process.setpriority(kind, integer, priority) → 0
process.c
View on GitHub ↗
static VALUE
proc_setpriority(VALUE obj, VALUE which, VALUE who, VALUE prio)
{
int iwhich, iwho, iprio;
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
iprio = NUM2INT(prio);
if (setpriority(iwhich, iwho, iprio) < 0)
rb_sys_fail(0);
return INT2FIX(0);
}
See Process.getpriority.
Example
Process.setpriority(Process::PRIO_USER, 0, 19) #=> 0 Process.setpriority(Process::PRIO_PROCESS, 0, 19) #=> 0 Process.getpriority(Process::PRIO_USER, 0) #=> 19 Process.getpriority(Process::PRIO_PROCESS, 0) #=> 19