about summary refs log tree commit diff
path: root/src/unistd/nice.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unistd/nice.c')
-rw-r--r--src/unistd/nice.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/unistd/nice.c b/src/unistd/nice.c
index 4b28ef41..f38db678 100644
--- a/src/unistd/nice.c
+++ b/src/unistd/nice.c
@@ -1,7 +1,12 @@
 #include <unistd.h>
+#include <sys/resource.h>
 #include "syscall.h"
 
 int nice(int inc)
 {
+#ifdef __NR_nice
 	return syscall1(__NR_nice, inc);
+#else
+	return setpriority(PRIO_PROCESS, 0, getpriority(PRIO_PROCESS, 0)+inc);
+#endif
 }