diff --git a/include/sys/resource.h b/include/sys/resource.h index 494e9a1d28..ca0be2c60b 100644 --- a/include/sys/resource.h +++ b/include/sys/resource.h @@ -59,6 +59,11 @@ #define RLIMIT_AS 7 /* Limit on address space size */ #define RLIMIT_MEMLOCK 8 /* Limit on memory use */ +/* Below are not implemented yet: */ + +#define RLIMIT_RTPRIO 14 /* Limit on RT tasks priority */ +#define RLIMIT_RTTIME 15 /* Limit on timeout for RT tasks (us) */ + #if defined(CONFIG_FS_LARGEFILE) # define RLIM_INFINITY UINT64_MAX /* No limit */ # define RLIM_SAVED_MAX UINT64_MAX /* Unrepresentable saved hard limit */ diff --git a/libs/libc/unistd/lib_getrlimit.c b/libs/libc/unistd/lib_getrlimit.c index 3e8655c2e5..c523852ff7 100644 --- a/libs/libc/unistd/lib_getrlimit.c +++ b/libs/libc/unistd/lib_getrlimit.c @@ -71,6 +71,18 @@ int getrlimit(int resource, FAR struct rlimit *rlp) rlp->rlim_max = RLIM_INFINITY; } break; + case RLIMIT_RTPRIO: + { + rlp->rlim_cur = SCHED_PRIORITY_DEFAULT; + rlp->rlim_max = SCHED_PRIORITY_MAX; + } + break; + case RLIMIT_RTTIME: + { + rlp->rlim_cur = UINT32_MAX; + rlp->rlim_max = UINT32_MAX; + } + break; default: break; }