. pci driver now returns devices, even when they have been pci_reserve()d
[minix3.git] / lib / posix / priority.c
blob29c68c9b0d865f1749efd511b6dd7fafb3b33aa9
1 /*
2 priority.c
3 */
5 #include <errno.h>
6 #include <sys/types.h>
7 #include <sys/resource.h>
8 #include <lib.h>
9 #include <unistd.h>
10 #include <string.h>
11 #include <stddef.h>
14 int getpriority(int which, int who)
16 int v;
17 message m;
19 m.m1_i1 = which;
20 m.m1_i2 = who;
22 /* GETPRIORITY returns negative for error.
23 * Otherwise, it returns the priority plus the minimum
24 * priority, to distiginuish from error. We have to
25 * correct for this. (The user program has to check errno
26 * to see if something really went wrong.)
29 if((v = _syscall(MM, GETPRIORITY, &m)) < 0) {
30 return v;
33 return v + PRIO_MIN;
36 int setpriority(int which, int who, int prio)
38 message m;
40 m.m1_i1 = which;
41 m.m1_i2 = who;
42 m.m1_i3 = prio;
44 return _syscall(MM, SETPRIORITY, &m);