summaryrefslogtreecommitdiff
path: root/include/sys/resource.h
blob: 79fcf2355c0b5a3f5121102ce1ae7a8b18335bdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#ifndef __SYS_RESOURCE_H
#define __SYS_RESOURCE_H

typedef __INT64_TYPE__ time_t;
typedef __INT64_TYPE__ suseconds_t;

struct __timeval {
	time_t tv_sec;
	suseconds_t tv_usec;
};

#define RUSAGE_SELF	0
#define RUSAGE_CHILDREN (-1)
#define RUSAGE_BOTH	(-2)
#define RUSAGE_THREAD	1

struct rusage {
	struct __timeval ru_utime;
	struct __timeval ru_stime;
	long ru_maxrss;
	long ru_ixrss;
	long ru_idrss;
	long ru_isrss;
	long ru_minflt;
	long ru_majflt;
	long ru_nswap;
	long ru_inblock;
	long ru_oublock;
	long ru_msgsnd;
	long ru_msgrcv;
	long ru_nsignals;
	long ru_nvcsw;
	long ru_nivcsw;
};

#define PRIO_MIN (-20)
#define PRIO_MAX 20

#define PRIO_PROCESS 0
#define PRIO_PGRP    1
#define PRIO_USER    2

int getpriority(int, int);
int setpriority(int, int, int);
int getrusage(int, struct rusage *);

#endif