setpriority(p1, p2, p3)
public
Show source
/*
* call-seq:
* Process.setpriority(kind, integer, priority) => 0
*
* See <code>Process#getpriority</code>.
*
* Process.setpriority(Process::PRIO_USER, 0, 19)
* Process.setpriority(Process::PRIO_PROCESS, 0, 19)
* Process.getpriority(Process::PRIO_USER, 0)
* Process.getpriority(Process::PRIO_PROCESS, 0)
*/
static VALUE
proc_setpriority(obj, which, who, prio)
VALUE obj, which, who, prio;
{
#ifdef HAVE_GETPRIORITY
int iwhich, iwho, iprio;
rb_secure(2);
iwhich = NUM2INT(which);
iwho = NUM2INT(who);
iprio = NUM2INT(prio);
if (setpriority(iwhich, iwho, iprio) < 0)
rb_sys_fail(0);
return INT2FIX(0);
#else
rb_notimplement();
#endif
}