diff options
Diffstat (limited to '05/musl-0.6.0/src/unistd/nice.c')
-rw-r--r-- | 05/musl-0.6.0/src/unistd/nice.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/05/musl-0.6.0/src/unistd/nice.c b/05/musl-0.6.0/src/unistd/nice.c new file mode 100644 index 0000000..f38db67 --- /dev/null +++ b/05/musl-0.6.0/src/unistd/nice.c @@ -0,0 +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 +} |