Commit | Line | Data |
---|---|---|
bb0cfa24 | 1 | /* |
bfd3a734 KB |
2 | * Copyright (c) 1983 The Regents of the University of California. |
3 | * All rights reserved. | |
4 | * | |
269a7923 | 5 | * %sccs.include.redist.c% |
bb0cfa24 DF |
6 | */ |
7 | ||
2ce81398 | 8 | #if defined(LIBC_SCCS) && !defined(lint) |
c5980113 | 9 | static char sccsid[] = "@(#)nice.c 5.5 (Berkeley) %G%"; |
bfd3a734 | 10 | #endif /* LIBC_SCCS and not lint */ |
39ddd9b2 SL |
11 | |
12 | #include <sys/time.h> | |
13 | #include <sys/resource.h> | |
c5980113 | 14 | #include <unistd.h> |
39ddd9b2 SL |
15 | |
16 | /* | |
17 | * Backwards compatible nice. | |
18 | */ | |
c5980113 | 19 | int |
39ddd9b2 SL |
20 | nice(incr) |
21 | int incr; | |
22 | { | |
23 | int prio; | |
24 | extern int errno; | |
25 | ||
26 | errno = 0; | |
27 | prio = getpriority(PRIO_PROCESS, 0); | |
28 | if (prio == -1 && errno) | |
29 | return (-1); | |
30 | return (setpriority(PRIO_PROCESS, 0, prio + incr)); | |
31 | } |