9 #include <sys/resource.h>
16 int getpriority(int which
, id_t who
)
21 memset(&m
, 0, sizeof(m
));
22 m
.m_lc_pm_priority
.which
= which
;
23 m
.m_lc_pm_priority
.who
= who
;
25 /* GETPRIORITY returns negative for error.
26 * Otherwise, it returns the priority plus the minimum
27 * priority, to distiginuish from error. We have to
28 * correct for this. (The user program has to check errno
29 * to see if something really went wrong.)
32 if((v
= _syscall(PM_PROC_NR
, PM_GETPRIORITY
, &m
)) < 0) {
39 int setpriority(int which
, id_t who
, int prio
)
43 memset(&m
, 0, sizeof(m
));
44 m
.m_lc_pm_priority
.which
= which
;
45 m
.m_lc_pm_priority
.who
= who
;
46 m
.m_lc_pm_priority
.prio
= prio
;
48 return _syscall(PM_PROC_NR
, PM_SETPRIORITY
, &m
);