diff options
author | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 |
---|---|---|
committer | "Steven J. Hill" <sjhill@realitydiluted.com> | 2006-02-28 03:18:23 +0000 |
commit | 675d62ac876ffe4719580d45b8c9469934ccf6d7 (patch) | |
tree | e666bd4a1d816842c070e4928715d66b82655fc2 /libc/sysdeps/linux/common/nice.c | |
parent | fd666fca933f7241ff75d06ff36c9282fd443335 (diff) | |
download | uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.bz2 uClibc-alpine-675d62ac876ffe4719580d45b8c9469934ccf6d7.tar.xz |
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/common/nice.c')
-rw-r--r-- | libc/sysdeps/linux/common/nice.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/libc/sysdeps/linux/common/nice.c b/libc/sysdeps/linux/common/nice.c index 20f7996a7..e6e80e7be 100644 --- a/libc/sysdeps/linux/common/nice.c +++ b/libc/sysdeps/linux/common/nice.c @@ -2,27 +2,28 @@ /* * nice() for uClibc * - * Copyright (C) 2000-2004 by Erik Andersen <andersen@codepoet.org> * Copyright (C) 2005 by Manuel Novoa III <mjn3@codepoet.org> + * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org> * - * GNU Library General Public License (LGPL) version 2 or later. + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ -#define getpriority __getpriority -#define setpriority __setpriority - #include "syscalls.h" #include <unistd.h> #include <sys/resource.h> +libc_hidden_proto(getpriority) + #ifdef __NR_nice -#define __NR___syscall_nice __NR_nice +# define __NR___syscall_nice __NR_nice static inline _syscall1(int, __syscall_nice, int, incr); #else -#include <limits.h> +# include <limits.h> + +libc_hidden_proto(setpriority) static inline int int_add_no_wrap(int a, int b) { @@ -40,10 +41,10 @@ static inline int int_add_no_wrap(int a, int b) static inline int __syscall_nice(int incr) { int old_priority; -#if 1 +# if 1 /* This should never fail. */ old_priority = getpriority(PRIO_PROCESS, 0); -#else +# else /* But if you want to be paranoid... */ int old_errno; @@ -54,7 +55,7 @@ static inline int __syscall_nice(int incr) return -1; } __set_errno(old_errno); -#endif +# endif if (setpriority(PRIO_PROCESS, 0, int_add_no_wrap(old_priority, incr))) { __set_errno(EPERM); /* SUSv3 mandates EPERM for nice failure. */ |