1 /*
2  * Copyright 2015 The Native Client Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6 
7 #ifndef NATIVE_CLIENT_SRC_PUBLIC_LINUX_SYSCALLS_SYS_RESOURCE_H_
8 #define NATIVE_CLIENT_SRC_PUBLIC_LINUX_SYSCALLS_SYS_RESOURCE_H_
9 
10 /*
11  * Here, we declare this is a system header by #pragma directive to disable
12  * warning.
13  */
14 #pragma GCC system_header
15 #include_next <sys/resource.h>
16 
17 #include <stdint.h>
18 
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22 
23 #define PRIO_PROCESS 0
24 
25 #define RLIMIT_DATA 2
26 #define RLIMIT_CORE 4
27 #define RLIMIT_NOFILE 7
28 #define RLIMIT_AS 9
29 
30 typedef uint32_t rlim_t;
31 
32 struct rlimit {
33   rlim_t rlim_cur;
34   rlim_t rlim_max;
35 };
36 
37 int getrlimit(int resource, struct rlimit *rlim);
38 int setrlimit(int resource, const struct rlimit *rlim);
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif
45