add acct syscall source file, omitted in last syscalls commit
[oweals/musl.git] / src / unistd / nice.c
index 4b28ef41fec1bb45531a491284267a5032bca604..da56996776e26aedd31b4c5495d24797cfbce070 100644 (file)
@@ -1,7 +1,12 @@
 #include <unistd.h>
+#include <sys/resource.h>
 #include "syscall.h"
 
 int nice(int inc)
 {
-       return syscall1(__NR_nice, inc);
+#ifdef SYS_nice
+       return syscall(SYS_nice, inc);
+#else
+       return setpriority(PRIO_PROCESS, 0, getpriority(PRIO_PROCESS, 0)+inc);
+#endif
 }