1 |
slords |
1.1 |
--- dietlibc-0.28-unpatched/lib/__nice.c 2005-02-13 18:01:18.966469056 -0500 |
2 |
|
|
+++ dietlibc-0.28/lib/__nice.c 2005-02-13 18:17:04.381744088 -0500 |
3 |
|
|
@@ -1,9 +1,13 @@ |
4 |
|
|
#include "syscalls.h" |
5 |
|
|
-#include <sys/time.h> |
6 |
|
|
+#include <errno.h> |
7 |
|
|
#include <sys/resource.h> |
8 |
|
|
|
9 |
|
|
#ifndef __NR_nice |
10 |
|
|
int nice(int i) { |
11 |
|
|
- return setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i); |
12 |
|
|
+ if (setpriority(PRIO_PROCESS,0,getpriority(PRIO_PROCESS,0)+i) == -1) { |
13 |
|
|
+ errno=EPERM; |
14 |
|
|
+ return -1; |
15 |
|
|
+ } |
16 |
|
|
+ return getpriority(PRIO_PROCESS,0); |
17 |
|
|
} |
18 |
|
|
#endif |