Tenok
A Linux-like Real-Time Operating System for Robotics and Internet of Things
Data Structures | Macros | Typedefs | Functions
resource.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  rlimit
 

Macros

#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 RLIM_INFINITY   (~0ULL)
 

Typedefs

typedef unsigned long long rlim_t
 

Functions

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 always read back the same. More...
 
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 asks for no more than what is already in effect can be granted. More...
 

Function Documentation

◆ getrlimit()

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 always read back the same.

Parameters
resourceOne of the RLIMIT_ values.
rlimThe buffer for returning the limit.
Return values
int0 on success and -1 on error, with the reason left in errno.

◆ setrlimit()

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 asks for no more than what is already in effect can be granted.

Parameters
resourceOne of the RLIMIT_ values.
rlimThe limit to apply.
Return values
int0 on success and -1 on error, with the reason left in errno.