chiark / gitweb /
[PATCH] sync with latest version of klibc (0.107)
[elogind.git] / klibc / klibc / getpriority.c
1 /*
2  * getpriority.c
3  *
4  * Needs to do some post-syscall mangling to distinguish error returns...
5  * but only on some platforms.  Sigh.
6  */
7
8 #include <unistd.h>
9 #include <sys/time.h>
10 #include <sys/resource.h>
11 #include <sys/syscall.h>
12
13 #define __NR__getpriority __NR_getpriority
14
15 static inline _syscall2(int,_getpriority,int,which,int,who);
16
17 int getpriority(int which, int who)
18 {
19 #if defined(__alpha__) || defined(__ia64__)
20   return _getpriority(which, who);
21 #else
22   int rv = _getpriority(which, who);
23   return ( rv < 0 ) ? rv : 20-rv;
24 #endif
25 }