Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
Process.getpriority
(::Integer kind, ::Integer arg0) -> ::Integer
Process.getpriority(kind, id) → integer
process.c
View on GitHub ↗
static VALUE
proc_getpriority(VALUE obj, VALUE which, VALUE who)
{
int prio, iwhich, iwho;
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
errno = 0;
prio = getpriority(iwhich, iwho);
if (errno) rb_sys_fail(0);
return INT2FIX(prio);
}
Returns the scheduling priority for specified process, process group, or user.
Argument kind is one of:
-
Process::PRIO_PROCESS: return priority for process. -
Process::PRIO_PGRP: return priority for process group. -
Process::PRIO_USER: return priority for user.
Argument id is the ID for the process, process group, or user; zero specified the current ID for kind.
Examples:
Example
Process.getpriority(Process::PRIO_USER, 0) # => 19 Process.getpriority(Process::PRIO_PROCESS, 0) # => 19
Not available on all platforms.