new copyright notice
[unix-history] / usr / src / lib / libc / gen / nice.c
CommitLineData
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)
269a7923 9static char sccsid[] = "@(#)nice.c 5.4 (Berkeley) %G%";
bfd3a734 10#endif /* LIBC_SCCS and not lint */
39ddd9b2
SL
11
12#include <sys/time.h>
13#include <sys/resource.h>
14
15/*
16 * Backwards compatible nice.
17 */
18nice(incr)
19 int incr;
20{
21 int prio;
22 extern int errno;
23
24 errno = 0;
25 prio = getpriority(PRIO_PROCESS, 0);
26 if (prio == -1 && errno)
27 return (-1);
28 return (setpriority(PRIO_PROCESS, 0, prio + incr));
29}