summaryrefslogtreecommitdiff
path: root/klibc/klibc/nice.c
blob: f0d97a3cd025ecafdb27572670e85411d8b0b08c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
 * nice.c
 */

#include <unistd.h>
#include <sched.h>
#include <sys/resource.h>
#include <sys/syscall.h>

#ifdef __NR_nice

_syscall1(int,nice,int,inc);

#else

int nice(int inc)
{
  pid_t me = getpid();
  return setpriority(me, PRIO_PROCESS, getpriority(me, PRIO_PROCESS)+inc);
}

#endif