Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
resource.h
Go to the documentation of this file.
1 
4 #ifndef __RESOURCE_H__
5 #define __RESOURCE_H__
6 
7 /* Resources a task can ask the limit of, with the numbers Linux gives them */
8 #define RLIMIT_CPU 0
9 #define RLIMIT_FSIZE 1
10 #define RLIMIT_DATA 2
11 #define RLIMIT_STACK 3
12 #define RLIMIT_CORE 4
13 #define RLIMIT_RSS 5
14 #define RLIMIT_NPROC 6
15 #define RLIMIT_NOFILE 7
16 #define RLIMIT_MEMLOCK 8
17 #define RLIMIT_AS 9
18 #define RLIMIT_LOCKS 10
19 #define RLIMIT_SIGPENDING 11
20 #define RLIMIT_MSGQUEUE 12
21 #define RLIMIT_NICE 13
22 #define RLIMIT_RTPRIO 14
23 
24 /* A resource Tenok does not count has no limit of its own */
25 #define RLIM_INFINITY (~0ULL)
26 
27 typedef unsigned long long rlim_t;
28 
29 struct rlimit {
30  rlim_t rlim_cur; /* The limit in effect */
31  rlim_t rlim_max; /* The most it can be raised to */
32 };
33 
41 int getrlimit(int resource, struct rlimit *rlim);
42 
51 int setrlimit(int resource, const struct rlimit *rlim);
52 
53 #endif
int getrlimit(int resource, struct rlimit *rlim)
Read the limit of a resource. The limits of Tenok are properties of the build, so the two fields alwa...
Definition: resource.c:9
int setrlimit(int resource, const struct rlimit *rlim)
Replace the limit of a resource. Every limit of Tenok is fixed at the build, so only a request that a...
Definition: resource.c:46
Definition: resource.h:29