minix/lib/libc/posix/nice.c

20 lines
249 B
C
Raw Normal View History

2006-10-20 16:10:53 +02:00
/*
nice.c
*/
#include <errno.h>
#include <unistd.h>
#include <sys/resource.h>
int nice(incr)
int incr;
{
int r;
errno= 0;
r= getpriority(PRIO_PROCESS, 0);
if (r == -1 && errno != 0)
return r;
return setpriority(PRIO_PROCESS, 0, r+incr);
}