-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathrlimit.h
More file actions
31 lines (28 loc) · 825 Bytes
/
rlimit.h
File metadata and controls
31 lines (28 loc) · 825 Bytes
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
#include <syscall.h>
#include <bits/types.h>
#define RLIMIT_CPU 0
#define RLIMIT_FSIZE 1
#define RLIMIT_DATA 2
#define RLIMIT_STACK 3
#define RLIMIT_CORE 4
#define RLIMIT_RSS 5
#define RLIMIT_NPROC 6
#define RLIMIT_NOFILE 7
#define RLIMIT_MEMLOCK 8
#define RLIMIT_AS 9
#define RLIMIT_LOCKS 10
#define RLIMIT_SIGPENDING 11
#define RLIMIT_MSGQUEUE 12
#define RLIMIT_NICE 13
#define RLIMIT_RTPRIO 14
#define RLIMIT_RTTIME 15
#define RLIM_NLIMITS 16
struct rlimit {
uint64_t cur;
uint64_t max;
};
inline static long sys_prlimit(int pid, int key, const struct rlimit* set,
struct rlimit* get)
{
return syscall4(NR_prlimit64, pid, key, (long)set, (long)get);
}