File: getpriority.c

package info (click to toggle)
klibc 2.0.1-3.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,248 kB
  • sloc: ansic: 47,887; asm: 2,394; perl: 758; makefile: 193; sh: 183
file content (23 lines) | stat: -rw-r--r-- 434 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/*
 * getpriority.c
 *
 * Needs to do some post-syscall mangling to distinguish error returns...
 * but only on some platforms.  Sigh.
 */

#include <unistd.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/syscall.h>

#if !defined(__alpha__) && !defined(__ia64__)

extern int __getpriority(int, int);

int getpriority(int which, int who)
{
	int rv = __getpriority(which, who);
	return (rv < 0) ? rv : 20-rv;
}

#endif